View Full Version : Custom taper / Java

July 21st, 2010, 09:25 AM
I am looking to somehow integrate amanda with a 3rd party storage API written in Java. If I understand correctly, the conventional way to write a custom Driver is to implement the Driver API (in C), however I would like to avoid this since I would have to use JNI to communicate with the Java VM and vise-versa.

My question is: is it possible to implement a custom Taper (in Java) according to the Driver-Taper protocol (http://wiki.zmanda.com/index.php/Driver-Taper_protocol) and invoke it from within the Driver?

Would very much appreciate any suggestions or advice...

July 21st, 2010, 01:16 PM
I would advise very strongly against implementing a custom taper, as the driver/taper protocol is internal to Amanda, and will go away completely in a subsequent release.

You're talking about the Device API, not the Driver API. You could implement this with the JNI, or you could implement it via some sort of IPC, with the device (in C) interfacing with a separate Java process that communicates with the storage API.

If you do decide to proceed, please subscribe to the amanda-hackers mailing list and keep us abreast of your progress. These forums are mostly for user support.

If you don't mind my asking, what sort of API are you interfacing to? Would you be willing to open-source your work?

July 23rd, 2010, 01:59 AM
Thanks for your advice., I will implement the device api and open-source the project if successful.

I'm looking at the S3 device as an example implementation and have some quick questions:

- I've read somewhere that S3 backup is only available in the enterprise edition; is this correct? I am trying to test with the community edition (3.1.1 and 2.6.1p2)

- the packages for my host (debian testing/squeeze) are not compiled with S3 device support, so I have compiled from source along with glib 2.24.1. I've configured my test environment according to the S3 device guide, however when I try to run amlabel, the following error is produced in both 3.1.1 and 2.6.1p2: ERROR:glib-util.c:48:glib_init: assertion failed: (!g_thread_supported). I understand this has something to do with curl initialisation. In an attempt to get it working, I commented out line 48 in glib-util.c (g_assert(!g_thread_supported());). However after this, amlabel just hangs - If I examine the http requests to amazon, I see lots of HTTP 404's (file not found). Should the bucket be created on S3 before hand, i.e., manually?

Thanks again for your advice

July 23rd, 2010, 11:30 AM
S3 is available everywhere - the source is in device-src/s3-*.

The glib error has to do with the version of glib - the glib folks restricted the order in which the initialization functions must be called. 3.1.2 (or, if you prefer, the current trunk) will run just fine with glibs >= 2.24.0. Alternately, if you can downgrade glib then 3.1.1 will work fine.

The fix is