当前位置: 首页>>代码示例>>Java>>正文


Java Base64.encodeBytes方法代码示例

本文整理汇总了Java中org.apache.hadoop.hbase.util.Base64.encodeBytes方法的典型用法代码示例。如果您正苦于以下问题:Java Base64.encodeBytes方法的具体用法?Java Base64.encodeBytes怎么用?Java Base64.encodeBytes使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.hadoop.hbase.util.Base64的用法示例。


在下文中一共展示了Base64.encodeBytes方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ByteArrayComparableModel

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
public ByteArrayComparableModel(
    ByteArrayComparable comparator) {
  String typeName = comparator.getClass().getSimpleName();
  ComparatorType type = ComparatorType.valueOf(typeName);
  this.type = typeName;
  switch (type) {
    case BinaryComparator:
    case BinaryPrefixComparator:
      this.value = Base64.encodeBytes(comparator.getValue());
      break;
    case BitComparator:
      this.value = Base64.encodeBytes(comparator.getValue());
      this.op = ((BitComparator)comparator).getOperator().toString();
      break;
    case NullComparator:
      break;
    case RegexStringComparator:
    case SubstringComparator:
      this.value = Bytes.toString(comparator.getValue());
      break;
    default:
      throw new RuntimeException("unhandled filter type: " + type);
  }
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:25,代码来源:ScannerModel.java

示例2: WritableByteArrayComparableModel

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
public WritableByteArrayComparableModel(
    WritableByteArrayComparable comparator) {
  String typeName = comparator.getClass().getSimpleName();
  ComparatorType type = ComparatorType.valueOf(typeName);
  this.type = typeName;
  switch (type) {
    case BinaryComparator:
    case BinaryPrefixComparator:
      this.value = Base64.encodeBytes(comparator.getValue());
      break;
    case BitComparator:
      this.value = Base64.encodeBytes(comparator.getValue());
      this.op = ((BitComparator)comparator).getOperator().toString();
      break;
    case NullComparator:
      break;
    case RegexStringComparator:
    case SubstringComparator:
      this.value = Bytes.toString(comparator.getValue());
      break;
    default:
      throw new RuntimeException("unhandled filter type: " + type);
  }
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:25,代码来源:ScannerModel.java

示例3: convertScanToString

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
private static String convertScanToString(Scan scan) {
    try {
        ByteArrayOutputStream out = new ByteArrayOutputStream();
        DataOutputStream dos = new DataOutputStream(out);
        scan.write(dos);
        return Base64.encodeBytes(out.toByteArray());
    } catch (IOException e) {
        LOG.error(e);
        return "";
    }

}
 
开发者ID:sigmoidanalytics,项目名称:spork-streaming,代码行数:13,代码来源:HBaseStorage.java

示例4: convertScanToString

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Writes the given scan into a Base64 encoded string.
 *
 * @param scan  The scan to write out.
 * @return The scan saved in a Base64 encoded string.
 * @throws IOException When writing the scan fails.
 */
public static String convertScanToString(Scan scan) throws IOException{
    ObjectOutput dos=null;
    try{
        byte[] bytes=ProtobufUtil.toScan(scan).toByteArray();
        return Base64.encodeBytes(bytes);
    }finally{
        if(dos!=null)
            dos.close();
    }
}
 
开发者ID:splicemachine,项目名称:spliceengine,代码行数:18,代码来源:SpliceTableMapReduceUtil.java

示例5: convertScanToString

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
static String convertScanToString(Scan scan) throws IOException {
    ClientProtos.Scan proto = ProtobufUtil.toScan(scan);
    return Base64.encodeBytes(proto.toByteArray());
}
 
开发者ID:yjp123456,项目名称:SparkDemo,代码行数:5,代码来源:HBaseTest.java

示例6: convertScanToString

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
static String convertScanToString(Scan scan) throws IOException {
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  DataOutputStream dos = new DataOutputStream(out);
  scan.write(dos);
  return Base64.encodeBytes(out.toByteArray());
}
 
开发者ID:XiaoMi,项目名称:themis,代码行数:7,代码来源:ThemisTableMapReduceUtil.java

示例7: encode

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
private String encode(String value) {
    return Base64.encodeBytes(value.getBytes(UTF8));
}
 
开发者ID:naver,项目名称:pinpoint,代码行数:4,代码来源:AcceptUrlFilterTest.java

示例8: encode

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
private String encode(String value) {
    return Base64.encodeBytes(value.getBytes(StandardCharsets.UTF_8));
}
 
开发者ID:naver,项目名称:pinpoint,代码行数:4,代码来源:RpcURLPatternFilterTest.java

示例9: encodeUrl

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
private String encodeUrl(String value) {
    return Base64.encodeBytes(value.getBytes(StandardCharsets.UTF_8));
}
 
开发者ID:naver,项目名称:pinpoint,代码行数:4,代码来源:LinkFilterTest.java

示例10: convertScanToString

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Writes the given scan into a Base64 encoded string.
 *
 * @param scan  The scan to write out.
 * @return The scan saved in a Base64 encoded string.
 * @throws IOException When writing the scan fails.
 */
static String convertScanToString(Scan scan) throws IOException {
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  DataOutputStream dos = new DataOutputStream(out);
  scan.write(dos);
  return Base64.encodeBytes(out.toByteArray());
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:14,代码来源:TableMapReduceUtil.java

示例11: convertScanToString

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Writes the given scan into a Base64 encoded string.
 * 
 * @param scan
 *        The scan to write out.
 * @return The scan saved in a Base64 encoded string.
 * @throws IOException
 *         When writing the scan fails.
 */
static String convertScanToString(Scan scan) throws IOException {
	ByteArrayOutputStream out = new ByteArrayOutputStream();
	DataOutputStream dos = new DataOutputStream(out);
	scan.write(dos);
	return Base64.encodeBytes(out.toByteArray());
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:16,代码来源:HBaseUtil.java

示例12: convertScanToString

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Writes the given scan into a Base64 encoded string.
 *
 * @param scan  The scan to write out.
 * @return The scan saved in a Base64 encoded string.
 * @throws IOException When writing the scan fails.
 */
static String convertScanToString(Scan scan) throws IOException {
  ClientProtos.Scan proto = ProtobufUtil.toScan(scan);
  return Base64.encodeBytes(proto.toByteArray());
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:12,代码来源:TableMapReduceUtil.java

示例13: convertScanToString

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Writes the given scan into a Base64 encoded string.
 *
 * @param scan  The scan to write out.
 * @return The scan saved in a Base64 encoded string.
 * @throws IOException When writing the scan fails.
 */
static String convertScanToString(Scan scan) throws IOException {
    ClientProtos.Scan proto = ProtobufUtil.toScan(scan);
    return Base64.encodeBytes(proto.toByteArray());
}
 
开发者ID:rayokota,项目名称:hgraphdb,代码行数:12,代码来源:IndexTool.java

示例14: convertScanToString

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * COPIED from {@link TableMapReduceUtil} since it's not visible in that class.
 * Makes this class somewhat brittle, but if we call the static method directly we
 * risk overwriting the mapper class.
 * 
 * @param scan			the scan to convert
 * @return				string-representation of the scan
 * @throws IOException	if encoding to base64 bytes fails
 */
protected String convertScanToString(Scan scan) throws IOException {
	ClientProtos.Scan proto = ProtobufUtil.toScan(scan);
    return Base64.encodeBytes(proto.toByteArray());
}
 
开发者ID:conversant,项目名称:mara,代码行数:14,代码来源:TableInputAnnotationHandler.java

示例15: convertScanToString

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Writes the given scan into a Base64 encoded string.
 *
 * @param scan The scan to write out.
 * @return The scan saved in a Base64 encoded string.
 * @throws IOException When writing the scan fails.
 */
private static String convertScanToString(Scan scan) throws IOException {
    ClientProtos.Scan proto = ProtobufUtil.toScan(scan);
    return Base64.encodeBytes(proto.toByteArray());
}
 
开发者ID:at15,项目名称:cs433,代码行数:12,代码来源:JobSubmitter.java


注:本文中的org.apache.hadoop.hbase.util.Base64.encodeBytes方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。