类org.apache.hadoop.fs.Syncable源码实例Demo

下面列出了怎么用org.apache.hadoop.fs.Syncable的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: hadoop   文件: CryptoStreamsTestBase.java
private void syncableCheck() throws IOException {
  OutputStream out = getOutputStream(smallBufferSize);
  try {
    int bytesWritten = dataLen / 3;
    out.write(data, 0, bytesWritten);
    ((Syncable) out).hflush();
    
    InputStream in = getInputStream(defaultBufferSize);
    verify(in, bytesWritten, data);
    in.close();
    
    out.write(data, bytesWritten, dataLen - bytesWritten);
    ((Syncable) out).hsync();
    
    in = getInputStream(defaultBufferSize);
    verify(in, dataLen, data);
    in.close();
  } finally {
    out.close();
  }
}
 
源代码2 项目: big-c   文件: CryptoStreamsTestBase.java
private void syncableCheck() throws IOException {
  OutputStream out = getOutputStream(smallBufferSize);
  try {
    int bytesWritten = dataLen / 3;
    out.write(data, 0, bytesWritten);
    ((Syncable) out).hflush();
    
    InputStream in = getInputStream(defaultBufferSize);
    verify(in, bytesWritten, data);
    in.close();
    
    out.write(data, bytesWritten, dataLen - bytesWritten);
    ((Syncable) out).hsync();
    
    in = getInputStream(defaultBufferSize);
    verify(in, dataLen, data);
    in.close();
  } finally {
    out.close();
  }
}
 
源代码3 项目: hadoop   文件: SyncableDataOutputStream.java
@Override
public void hflush() throws IOException {
  if (out instanceof Syncable) {
    ((Syncable) out).hflush();
  } else {
    out.flush();
  }
}
 
源代码4 项目: hadoop   文件: SyncableDataOutputStream.java
@Override
public void hsync() throws IOException {
  if (out instanceof Syncable) {
    ((Syncable) out).hsync();
  } else {
    out.flush();
  }
}
 
源代码5 项目: hadoop   文件: CryptoOutputStream.java
@Override
public void hflush() throws IOException {
  flush();
  if (out instanceof Syncable) {
    ((Syncable)out).hflush();
  }
}
 
源代码6 项目: hadoop   文件: CryptoOutputStream.java
@Override
public void hsync() throws IOException {
  flush();
  if (out instanceof Syncable) {
    ((Syncable)out).hsync();
  }
}
 
源代码7 项目: big-c   文件: SyncableDataOutputStream.java
@Override
public void hflush() throws IOException {
  if (out instanceof Syncable) {
    ((Syncable) out).hflush();
  } else {
    out.flush();
  }
}
 
源代码8 项目: big-c   文件: SyncableDataOutputStream.java
@Override
public void hsync() throws IOException {
  if (out instanceof Syncable) {
    ((Syncable) out).hsync();
  } else {
    out.flush();
  }
}
 
源代码9 项目: big-c   文件: CryptoOutputStream.java
@Override
public void hflush() throws IOException {
  flush();
  if (out instanceof Syncable) {
    ((Syncable)out).hflush();
  }
}
 
源代码10 项目: big-c   文件: CryptoOutputStream.java
@Override
public void hsync() throws IOException {
  flush();
  if (out instanceof Syncable) {
    ((Syncable)out).hsync();
  }
}
 
源代码11 项目: attic-apex-malhar   文件: FileSystemWAL.java
protected void flush() throws IOException
{
  if (outputStream != null) {
    if (fileSystemWAL.fileContext.getDefaultFileSystem() instanceof LocalFs ||
        fileSystemWAL.fileContext.getDefaultFileSystem() instanceof RawLocalFs) {
      //until the stream is closed on the local FS, readers don't see any data.
      close();
    } else {
      Syncable syncableOutputStream = (Syncable)outputStream;
      syncableOutputStream.hflush();
      syncableOutputStream.hsync();
    }
  }
}
 
源代码12 项目: pulsar   文件: HdfsSyncThread.java
public HdfsSyncThread(Syncable stream, BlockingQueue<Record<V>> unackedRecords, long syncInterval) {
  this.stream = stream;
  this.unackedRecords = unackedRecords;
  this.syncInterval = syncInterval;
}
 
源代码13 项目: pulsar   文件: HdfsSyncThread.java
public HdfsSyncThread(Syncable stream, BlockingQueue<Record<V>> unackedRecords, long syncInterval) {
  this.stream = stream;
  this.unackedRecords = unackedRecords;
  this.syncInterval = syncInterval;
}
 
 类所在包
 类方法
 同包方法