@@ -0,0 +1,1402 @@
+package com.neverwinterdp.storage.simplehdfs;%0A%0A%0Aimport org.apache.hadoop.conf.Configuration;%0Aimport org.apache.hadoop.fs.FSDataInputStream;%0Aimport org.apache.hadoop.fs.FSDataOutputStream;%0Aimport org.apache.hadoop.fs.FileSystem;%0Aimport org.apache.hadoop.fs.Path;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Apublic class DFSFileSystemHsyncExperimentTest %7B%0A  static String TEST_DIR = %22/tmp/dfs-test%22 ;%0A  private FileSystem fs ;%0A  %0A  @Before%0A  public void setup() throws Exception %7B%0A    System.setProperty(%22HADOOP_USER_NAME%22, %22neverwinterdp%22);%0A    %0A    Configuration conf = new Configuration();%0A    conf.set(%22HADOOP_USER_NAME%22, %22neverwinterdp%22);%0A    conf.set(%22fs.defaultFS%22, %22hdfs://hadoop-master:9000%22);%0A    fs = FileSystem.get(conf) ;%0A    if(fs.exists(new Path(TEST_DIR))) %7B%0A      fs.delete(new Path(TEST_DIR), true);%0A    %7D%0A    fs.mkdirs(new Path(TEST_DIR));%0A  %7D%0A  %0A  @After%0A  public void teardown() throws Exception %7B%0A    fs.close();%0A  %7D%0A  %0A  @Test%0A  public void testHsync() throws Exception %7B%0A    Path path = new Path(TEST_DIR + %22/file.txt%22);%0A    FSDataOutputStream os = fs.create(path);%0A    FSDataInputStream  is = fs.open(path);%0A    byte%5B%5D data = new byte%5B1024%5D;%0A    for(int i = 0 ; i %3C 1024; i++) %7B%0A      for(int j = 0; j %3C 128; j++) %7B%0A        os.write(data);%0A      %7D%0A      os.hsync();%0A      for(int j = 0; j %3C 128; j++) %7B%0A        is.readFully(data);%0A      %7D%0A    %7D%0A  %7D%0A%7D

add hsync test