Home > .NET, net core > Porting Apache Avro into .NET Core

Porting Apache Avro into .NET Core

We are from Geekseat has been used Avro extensively. Currently our project needs to be done on .NET core so .As i post previously i’m working on porting Apache Avro into .NET Core. Basically there are two Avro library available. One from Apache and one from Microsoft. I want to port both of library as that has been used a lot in big data application.

Let’s get back to Apache Avro.

There are two main problem that made headache when porting this one. One is AppDomain and IL Generator / Dynamic method is missing.

appdomainmissing

dynamicmethod

Both problem exists in the ObjectCreator.cs. This class is responsible for dynamically creating object on the fly based on the avro type.

ILGenerator has been known as the fastest object creator by Ayende Research. So i think this can be replaced with Expression tree but not sure how. Then i remember that Zeddy Iskandar has been create a forum post on how to create object with expression tree with constructor. You can see the method from this forum post. Here’s the complete source code of the ctor delegate.

One down, one more to go.

AppDomain has also been solved by Michael Whelan. Here’s the blog post around how to replace AppDomain.

I use the polyfill approach from that blog post. You can see that in action here.

After fixing both problem i’ve got 382 test passed and 6 failing. I’m quite happy with this result, declare victory and push that to repository. Thanks Zeddy and Michael.

test_passed

Cheers

 

 

Categories: .NET, net core Tags: , , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a comment