本文整理了Java中org.apache.storm.utils.Utils.gzip()
方法的一些代码示例,展示了Utils.gzip()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.gzip()
方法的具体详情如下:
包路径:org.apache.storm.utils.Utils
类名称:Utils
方法名:gzip
暂无
代码示例来源:origin: apache/storm
@Override
public byte[] serialize(Object object) {
try {
return Utils.gzip(new TSerializer().serialize((TBase) object));
} catch (TException e) {
throw new RuntimeException(e);
}
}
代码示例来源:origin: apache/storm
byte[] serializedState = Utils.gzip(Utils.thriftSerialize(st));
代码示例来源:origin: apache/storm
st.set_bolts(new HashMap<>());
st.set_state_spouts(new HashMap<>());
byte[] serializedState = Utils.gzip(Utils.thriftSerialize(st));
代码示例来源:origin: apache/storm
byte[] serializedState = Utils.gzip(Utils.thriftSerialize(st));
代码示例来源:origin: DigitalPebble/storm-crawler
@Override
public byte[] format(Tuple tuple) {
byte[] bytes = baseFormat.format(tuple);
return Utils.gzip(bytes);
}
}
代码示例来源:origin: DigitalPebble/storm-crawler
@Override
protected AbstractHDFSWriter makeNewWriter(Path path, Tuple tuple)
throws IOException {
AbstractHDFSWriter writer = super.makeNewWriter(path, tuple);
Date now = new Date();
// overrides the filename and creation date in the headers
header_fields.put("WARC-Date", WARCRecordFormat.WARC_DF.format(now));
header_fields.put("WARC-Filename", path.getName());
byte[] header = WARCRecordFormat.generateWARCInfo(header_fields);
// write the header at the beginning of the file
if (header != null && header.length > 0) {
super.out.write(Utils.gzip(header));
}
return writer;
}
代码示例来源:origin: org.apache.storm/storm-core
@Override
public byte[] serialize(Object object) {
try {
return Utils.gzip(new TSerializer().serialize((TBase) object));
} catch (TException e) {
throw new RuntimeException(e);
}
}
内容来源于网络,如有侵权,请联系作者删除!