Re: Accessing igfs file through java

2016-10-04 Thread vkulichenko
Sateesh,

IgfsPath should be a "local" path, e.g. /ignite/fs. You work with IGFS as
with a regular file system, but the data will be stored in a distributed
fashion on the cluster.

-Val



--
View this message in context: 
http://apache-ignite-users.70518.x6.nabble.com/Accessing-igfs-file-through-java-tp8073p8092.html
Sent from the Apache Ignite Users mailing list archive at Nabble.com.


Re: Accessing igfs file through java

2016-10-03 Thread Jörn Franke
You need to configure the igfs in the HDFS configuration file. Then you use the 
standard APIs to access HDFS files and it will go automatically through the 
cache.

> On 4 Oct 2016, at 07:35, Sateesh Karuturi  wrote:
> 
> Hello experts, 
> I am new to the Apache Ignite , and i need to access igfs file through java.
> Till now what i tried is :
> 
> import java.io.InputStream;
> 
> import org.apache.ignite.Ignite;
> import org.apache.ignite.IgniteFileSystem;
> import org.apache.ignite.Ignition;
> import org.apache.ignite.igfs.IgfsPath;
> 
> public class Ignite_Spark {
> 
>   public static void main(String[] args) throws Exception {
>   Ignite ignite = 
> Ignition.start("/usr/local/hadoop/apache-ignite-hadoop-1.6.0-bin/config/default-config.xml");
>   Ignite ignites = Ignition.ignite();
> 
>   IgniteFileSystem fs = ignites.fileSystem("igfs");
> 
>   IgfsPath workDir = new 
> IgfsPath("igfs://localhost:8020/ignite/fs");
>   fs.mkdirs(workDir);
> 
> 
>   IgfsPath filePath = new IgfsPath(workDir, "ttypes.csv");
> 
>   try (InputStream in = fs.open(filePath)) {
>   in.read();
>   }
>   }
> 
> }
> 
> 
> But getting  java.lang.IllegalArgumentException: Path should be absolute: 
> igfs://localhost:8020/ignite/fs exception.
> anyone please help me out.
> Thanks .
>