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 <sateesh.karutu...@gmail.com> 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 .
> 

Reply via email to