Discussion:
ANNOUNCEMENT: leveldb-sharp 1.9.0
Mirco Bauer
12 years ago
Permalink
I am very pleased to announce the release of leveldb-sharp 1.9.0!

This release matches up with the feature-set of LevelDB 1.9.0, which includes:

* low-level function calls to LevelDB
* high-level object oriented API with .NET enrichments (IEnumerable,
IDisposable)
* DB API
* ReadOptions/WriteOptions/Options API
* Write batch API
* Iterator API
* Cache API
* Snapshot API
* Compact range API
* Allows combined use of low-level and high-level APIs
* NUnit test-case coverage

Download:
https://www.meebey.net/projects/leveldb-sharp/downloads/leveldb-sharp-1.9.0.tar.gz

Website:
https://www.meebey.net/projects/leveldb-sharp/
--
Best regards,

Mirco 'meebey' Bauer

FOSS Developer ***@meebey.net https://www.meebey.net/
Debian Developer ***@debian.org http://www.debian.org/
GNOME Foundation Member ***@gnome.org http://www.gnome.org/
PGP-Key ID 0xEEF946C8
https://meebey.net/pubkey.asc
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Roman Polunin
12 years ago
Permalink
Mirco, thank you for this update.

Two suggestions:

1) in your mapping of leveldb_get you perform Marshal.PtrToStringAnsi on
the buffer returned from leveldb; however, you do not call leveldb_free on
that buffer. This looks like a memory leak.
2) strings are actually quite expensive; do you think that byte[] for both
key and value would be better? I'm going to add support for that in my copy
of the code anyway. Native functions are all the same, but there's no
additional byte->char conversion.
Post by Mirco Bauer
I am very pleased to announce the release of leveldb-sharp 1.9.0!
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Roman Polunin
12 years ago
Permalink
And the third one: libraries like this can be quite useful in server
applications, when there's a need to minimize overhead of temporary copies.
The C# mapping of leveldb_get would ideally put the data into an externally
provided byte buffer, instead of creating a new byte array or string every
time.
Thus, an application could be able to have a pool of those buffers for
reading the data (per thread). Most often, those values will either get
written into some output stream or will be used as input for an iterative
application.
One illustration for such a use case is BufferManager, a .NET utility class
which WCF team uses to manage temporary buffers for network packets.
...
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Mirco Bauer
12 years ago
Permalink
...
I agree, zero-copy should always be the goal. As the binding is pretty
new, I didn't want implement fancy stuff like that at first as
simplicity and stability was the short term goal.
Post by Roman Polunin
One illustration for such a use case is BufferManager, a .NET utility class
which WCF team uses to manage temporary buffers for network packets.
Interesting
--
Best regards,

Mirco 'meebey' Bauer

FOSS Developer ***@meebey.net https://www.meebey.net/
Debian Developer ***@debian.org http://www.debian.org/
GNOME Foundation Member ***@gnome.org http://www.gnome.org/
PGP-Key ID 0xEEF946C8 https://meebey.net/pubkey.asc
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Mirco Bauer
12 years ago
Permalink
Post by Roman Polunin
Mirco, thank you for this update.
1) in your mapping of leveldb_get you perform Marshal.PtrToStringAnsi on the
buffer returned from leveldb; however, you do not call leveldb_free on that
buffer. This looks like a memory leak.
I wasn't sure if I should free it or not. In the initial binding I did
and I had SEGVs. But when reading the C API comments/docs it's pretty
clear it has to be freed as the returned valued are malloc()ed. Thanks
for bringing this to my attention.
Post by Roman Polunin
2) strings are actually quite expensive; do you think that byte[] for both
key and value would be better? I'm going to add support for that in my copy
of the code anyway. Native functions are all the same, but there's no
additional byte->char conversion.
Yes, I agree on this. The other day I thought of making DB<T, V> which
could allow both byte, byte and string, string... a byte version is
really needed as leveldb allows to store arbitrary byte keys and
values and not just chars. Very good point. If you have something to
look at, please show/tell me!
--
Best regards,

Mirco 'meebey' Bauer

FOSS Developer ***@meebey.net https://www.meebey.net/
Debian Developer ***@debian.org http://www.debian.org/
GNOME Foundation Member ***@gnome.org http://www.gnome.org/
PGP-Key ID 0xEEF946C8 https://meebey.net/pubkey.asc
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Wallace Turner
12 years ago
Permalink
Post by Roman Polunin
2) strings are actually quite expensive; do you think that byte[] for both
key and value would be better? I'm going to add support for that in my copy
of the code anyway. Native functions are all the same, but there's no
additional byte->char conversion.

I agree, i have been checking out the source for leveldb-sharp and did a
global search for byte[] and came up empty!

Could you kindly send me your additions? I didnt see any forks of
leveldb-sharp...

Thank you

Wal
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Roman Polunin
12 years ago
Permalink
I'd rather not send the additions at this time. The things I'm doing with
leveldb are experimental only, and the code is not such that I would
publish.

If you want to make this mod, simple use LevelDB-CSharp's dll imports in
the "Native" namespace, and re-implement the wrapper. It's just a dozen
lines of code.

Regards,
Roman Polunin
...
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Tim Tillson
12 years ago
Permalink
Help! Can you point me to the Windows port of leveldb that leveldb-CSharp
needs to work? I compiled a port from kkowalczyk using Visual Studio C++
2010. It compiles and the test programs pass.
However, when I try to use that DLL with leveldb-CSharp VS tells me "A
reference to kkowalczyk....leveldb.dll could not be added. Please make sure
that the file is accessible, and that it is a valid assembly or
COM component". It may be that this port only provides C++ bindings whereas
you are using the C bindings?

Thank you, I really need this on Windows!!

Tim
...
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Roman Polunin
12 years ago
Permalink
You can only reference .NET assemblies like this. For regular native .DLL,
simply add it to your project as a source file, mark it as content and ask
compiler to copy it to binaries. The interop code will automatically search
for this dll by name at runtime.

Regards,
Roman Polunin
...
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Tim Tillson
12 years ago
Permalink
Roman,

I added the native .DLL to leveldb-CSharp, marked as content and asked the
compiler to copy it to binaries. I then recompiled and added the CSharp DLL
to my calling C# program as a reference.
In my calling program, I get the error:

Error: An attempt was made to load a program with an incorrect format.
(Exception from HRESULT: 0x8007000B) at
LevelDB.Native.leveldb_options_create()

at LevelDB.Options..ctor()

at Palantir.Myleveldb..ctor() in E:\twt\palantir\myleveldb.cs:line 16

at Palantir.Palform.X(Command cmd) in E:\twt\palantir\palform.cs:line
3568

at Palantir.Command.Execute() in E:\twt\palantir\talking.cs:line 426

at Palantir.Palform.Evalcmd(String buff) in
E:\twt\palantir\palform.cs:line 1381


Any suggestions? Thank you.

Tim
...
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Roman Polunin
12 years ago
Permalink
Maybe 32bit vs 64bit conflict?
Do you compile native DLL as 64 or 32?
If 64, make sure you compile .NET to 64bit or AnyCPU with "prefer 32
bit"=false.

Regards,
Roman Polunin
...
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
The Nguyen Xuan
10 years ago
Permalink
Help me

I added the leveldb-sharp.dll to my C# program as a reference, but I get
the error when run program:

"Unable to load DLL 'leveldb': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)"

I can not find leveldb.dll write by C API

Thank you,

The
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Elad Margalit
10 years ago
Permalink
I have the same problem, if some one has the solution or the compiled dll,
it would be great.

Thanks
Post by The Nguyen Xuan
Help me
I added the leveldb-sharp.dll to my C# program as a reference, but I get
"Unable to load DLL 'leveldb': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)"
I can not find leveldb.dll write by C API
Thank you,
The
--
You received this message because you are subscribed to the Google Groups "leveldb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to leveldb+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...