private void checkConsistency(int createBufSize,int writeCntsInCreate,int openAfterCreateBufSize,int appendBufSize,int writeCntsInAppend,int openAfterAppendBufSize) throws Exception {
  final Path igfsHome=new Path(PRIMARY_URI);
  Path file=new Path(igfsHome,"/someDir/someInnerDir/someFile");
  FSDataOutputStream os=fs.create(file,true,createBufSize);
  for (int i=0; i < writeCntsInCreate; i++)   os.writeInt(i);
  os.close();
  FSDataInputStream is=fs.open(file,openAfterCreateBufSize);
  for (int i=0; i < writeCntsInCreate; i++)   assertEquals(i,is.readInt());
  is.close();
  os=fs.append(file,appendBufSize);
  for (int i=writeCntsInCreate; i < writeCntsInCreate + writeCntsInAppend; i++)   os.writeInt(i);
  os.close();
  is=fs.open(file,openAfterAppendBufSize);
  for (int i=0; i < writeCntsInCreate + writeCntsInAppend; i++)   assertEquals(i,is.readInt());
  is.close();
}

private void checkConsistency ( int createBufSize , int writeCntsInCreate , int openAfterCreateBufSize , int appendBufSize , int writeCntsInAppend , int openAfterAppendBufSize ) throws Exception { final Path igfsHome = new Path ( PRIMARY_URI ) ; Path file = new Path ( igfsHome , "/someDir/someInnerDir/someFile" ) ; FSDataOutputStream os = fs . create ( file , true , createBufSize ) ; for ( int i = 0 ; i < writeCntsInCreate ; i ++ ) os . writeInt ( i ) ; os . close ( ) ; FSDataInputStream is = fs . open ( file , openAfterCreateBufSize ) ; for ( int i = 0 ; i < writeCntsInCreate ; i ++ ) assertEquals ( i , is . readInt ( ) ) ; is . close ( ) ; os = fs . append ( file , appendBufSize ) ; for ( int i = writeCntsInCreate ; i < writeCntsInCreate + writeCntsInAppend ; i ++ ) os . writeInt ( i ) ; os . close ( ) ; is = fs . open ( file , openAfterAppendBufSize ) ; for ( int i = 0 ; i < writeCntsInCreate + writeCntsInAppend ; i ++ ) assertEquals ( i , is . readInt ( ) ) ; is . close ( ) ; }
checks consistency of create - - > open - - > append - - > open operations with different buffer sizes .
