use of org.apache.heron.dlog.DLOutputStream in project heron by twitter.
the class DLUploader method openOutputStream.
protected OutputStream openOutputStream(String pkgName) throws IOException {
DistributedLogManager dlm = namespace.openLog(pkgName);
AppendOnlyStreamWriter writer = dlm.getAppendOnlyStreamWriter();
return new DLOutputStream(dlm, writer);
}
use of org.apache.heron.dlog.DLOutputStream in project heron by twitter.
the class DlogStorage method storeCheckpoint.
@Override
public void storeCheckpoint(CheckpointInfo info, Checkpoint checkpoint) throws StatefulStorageException {
String checkpointPath = getCheckpointPath(topologyName, info.getCheckpointId(), info.getComponent(), info.getInstanceId());
OutputStream out = null;
try {
out = openOutputStream(checkpointPath);
LOG.info(() -> String.format("writing a check point of %d bytes", checkpoint.getCheckpoint().getSerializedSize()));
checkpoint.getCheckpoint().writeTo(out);
out.flush();
} catch (IOException e) {
throw new StatefulStorageException("Failed to persist checkpoint @ " + checkpointPath, e);
} finally {
if (out != null) {
final long num = ((DLOutputStream) out).getNumOfBytesWritten();
LOG.info(() -> num + "bytes written");
}
SysUtils.closeIgnoringExceptions(out);
}
}
use of org.apache.heron.dlog.DLOutputStream in project heron by twitter.
the class DlogStorage method openOutputStream.
protected OutputStream openOutputStream(String path) throws IOException {
DistributedLogManager dlm = namespace.openLog(path);
AppendOnlyStreamWriter writer = dlm.getAppendOnlyStreamWriter();
return new DLOutputStream(dlm, writer);
}
Aggregations