0

I'm trying to make a fuse file system on top of an Mysql database, and use this from a windows client and this client request is passed on to Java Server on linux side over SAMBA!!

I need to know how to setup this kind of implementation

Working:

Step 1 : Client on windows side will Login.

Step 2 : After login user gives an 'ls' command.

Step 3 : This command should be proccessed as a C function

Step 4 : C function in turn issues the command as an argument to Java server using JSONCpp or Thrift

Step 5 : This Function calls on to Java server running on Linux.

Step 6 : Java Server interacts with the Mysql database and fetches the result

Step 7 : This result is should be displayed on client terminal on windows.

Mahesh Nayak
  • 208
  • 4
  • 14

3 Answers3

2
  1. Write a fuse filesystem that has the callbacks you want to handle.
  2. Forward the fuse callbacks over a local socket to which your Java code listens.
  3. Java server runs the query and returns the result through the socket (in 2).
  4. Fuse system return the information it reads from the socket (in 2)
  5. Share your fuse system over samba.
perreal
  • 94,503
  • 21
  • 155
  • 181
  • Thanks a lot!!! Any idea on Fuse Filesystem or Skeletal view of FS that is providing this service?? Coz i'm on a deadline!! – Mahesh Nayak Mar 14 '13 at 07:18
  • Sorry, no idea, but seems like you can find some template fuse examples start quickly. good luck :) – perreal Mar 14 '13 at 07:23
1

I don't exactly understand which language functions do you want to call from which language.

But there are two primary ways of cross-language communications.

  • You can simply use Sockets. Create a socket connection in language A's program that listens on a particular port. In another language B, pass in arguments to a function in A's program, which is listening for an input. And it will execute the function and return an output to B's program. You can easily find socket examples for JAVA and C online.

  • Communicate by extending languages. This is more low-level than socket. It is basically calling function/library in another language A from a different language B. For example you can extend Python to C like this. And you can call C library functions from JAVA using Java Native Interface.

Depending on your use and comfort levels you can use any of above methods for cross-language service implementations.

Sravan
  • 553
  • 8
  • 15
0

For the windows side, you can start with DokanMirror. Implements most call backs and is a good enough framework to start with. Linux side will mostly be your own code, so as the Socket interface. Using TCP/IP sockets is an overkill and be careful about thread hangs and timeouts.

a. Make the login a userspace application that will directly connect to your linux side and authenticate. b. This userspace application will then install and mount a virtual drive (using dokan). c. In the dokan-callbacks (in userspace) you can use tcp/ip to connect to you linux box.

What do you mean by over Samba? If you intend to share your filesystem, then perreal's answer (point 5) is correct.

Vikram
  • 41
  • 1
  • 4