I have installed Alluxio on local with Spark and I have inserted 1000 files in the memory of Alluxio.
Nevertheless read file is very slow.
File-reading time from Alluxio memory is equal file-reading time from disk.
I don't understand why.
File Name Size Block Size In-Memory Persistence State Pin Creation Time Modification Time
file1 54.73KB 512.00MB 100% NOT_PERSISTED NO 08-16-2016 12:52:31:278 08-16-2016 12:52:31:372
file2 54.73KB 512.00MB 100% NOT_PERSISTED NO 08-16-2016 12:52:31:377 08-16-2016 12:52:31:384
file3 54.72KB 512.00MB 100% NOT_PERSISTED NO 08-16-2016 12:52:31:386 08-16-2016 12:52:31:393
file4 54.71KB 512.00MB 100% NOT_PERSISTED NO 08-16-2016 12:52:31:394 08-16-2016 12:52:31:400
file5 54.72KB 512.00MB 100% NOT_PERSISTED NO 08-16-2016 12:52:31:401 08-16-2016 12:52:31:407
...
I read data with file API :
FileSystem fs = FileSystem.Factory.get();
AlluxioURI path = new AlluxioURI(/partition0);
List<URIStatus> status = fs.listStatus(path);
for (int i=0; i<status.size(); i++)
{
path = new AlluxioURI(status.get(i).getPath());
if(fs.exists(path)==true)
{
FileInStream in = fs.openFile(path);
String file = "";
InputStreamReader ipsr = new InputStreamReader(in);
BufferedReader br=new BufferedReader(ipsr);
String line;
line=br.readLine();
while (line != null){
//System.out.println(line);
file = file + line;
line=br.readLine();
}
byte[] cfv = file.getBytes();
br.close();
// Close file relinquishing the lock
in.close();
}
}
I don't use Spark for now because the test to read a partition with 1000 files is very slow... (I want read file by partition with Spark in the future).
Why read time using this method/library so slow ?