org.apache.storm.utils.Utils.gzip()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(1.7k)|赞(0)|评价(0)|浏览(139)

本文整理了Java中org.apache.storm.utils.Utils.gzip()方法的一些代码示例,展示了Utils.gzip()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Utils.gzip()方法的具体详情如下:
包路径:org.apache.storm.utils.Utils
类名称:Utils
方法名:gzip

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);
  }
}

相关文章

Utils类方法