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


Java Base64.decode方法代码示例

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


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

示例1: doSetup

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Handles common parameter initialization that a subclass might want to leverage.
 * @param context
 */
protected void doSetup(Context context) {
  Configuration conf = context.getConfiguration();

  // If a custom separator has been used,
  // decode it back from Base64 encoding.
  separator = conf.get(ImportTsv.SEPARATOR_CONF_KEY);
  if (separator == null) {
    separator = ImportTsv.DEFAULT_SEPARATOR;
  } else {
    separator = new String(Base64.decode(separator));
  }

  skipBadLines = context.getConfiguration().getBoolean(ImportTsv.SKIP_LINES_CONF_KEY, true);
  badLineCount = context.getCounter("ImportTsv", "Bad Lines");
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:20,代码来源:TsvImporterTextMapper.java

示例2: doSetup

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Handles common parameter initialization that a subclass might want to leverage.
 * @param context
 */
protected void doSetup(Context context) {
  Configuration conf = context.getConfiguration();

  // If a custom separator has been used,
  // decode it back from Base64 encoding.
  separator = conf.get(ImportTsv.SEPARATOR_CONF_KEY);
  if (separator == null) {
    separator = ImportTsv.DEFAULT_SEPARATOR;
  } else {
    separator = new String(Base64.decode(separator));
  }

  // Should never get 0 as we are setting this to a valid value in job configuration.
  ts = conf.getLong(ImportTsv.TIMESTAMP_CONF_KEY, 0);

  skipBadLines = context.getConfiguration().getBoolean(ImportTsv.SKIP_LINES_CONF_KEY, true);
  badLineCount = context.getCounter("ImportTsv", "Bad Lines");
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:23,代码来源:TextSortReducer.java

示例3: doSetup

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Handles common parameter initialization that a subclass might want to leverage.
 * @param context
 */
protected void doSetup(Context context) {
  Configuration conf = context.getConfiguration();

  // If a custom separator has been used,
  // decode it back from Base64 encoding.
  separator = conf.get(ImportTsv.SEPARATOR_CONF_KEY);
  if (separator == null) {
    separator = ImportTsv.DEFAULT_SEPARATOR;
  } else {
    separator = new String(Base64.decode(separator));
  }
  // Should never get 0 as we are setting this to a valid value in job
  // configuration.
  ts = conf.getLong(ImportTsv.TIMESTAMP_CONF_KEY, 0);

  skipBadLines = context.getConfiguration().getBoolean(
      ImportTsv.SKIP_LINES_CONF_KEY, true);
  badLineCount = context.getCounter("ImportTsv", "Bad Lines");
  hfileOutPath = conf.get(ImportTsv.BULK_OUTPUT_CONF_KEY);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:25,代码来源:TsvImporterMapper.java

示例4: doSetup

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Handles common parameter initialization that a subclass might want to leverage.
 * @param context
 */
protected void doSetup(Context context) {
  Configuration conf = context.getConfiguration();

  // If a custom separator has been used,
  // decode it back from Base64 encoding.
  separator = conf.get(ImportTsv.SEPARATOR_CONF_KEY);
  if (separator == null) {
    separator = ImportTsv.DEFAULT_SEPARATOR;
  } else {
    separator = new String(Base64.decode(separator));
  }

  // Should never get 0 as we are setting this to a valid value in job
  // configuration.
  ts = conf.getLong(ImportTsv.TIMESTAMP_CONF_KEY, 0);

  skipBadLines = context.getConfiguration().getBoolean(
      ImportTsv.SKIP_LINES_CONF_KEY, true);
  badLineCount = context.getCounter("ImportTsv", "Bad Lines");
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:25,代码来源:TsvImporterMapper.java

示例5: doSetup

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Handles common parameter initialization that a subclass might want to leverage.
 * @param context
 */
protected void doSetup(Context context) {
  Configuration conf = context.getConfiguration();

  // If a custom separator has been used,
  // decode it back from Base64 encoding.
  separator = conf.get(ImportTsv.SEPARATOR_CONF_KEY);
  if (separator == null) {
    separator = ImportTsv.DEFAULT_SEPARATOR;
  } else {
    separator = new String(Base64.decode(separator));
  }

  // Should never get 0 as we are setting this to a valid value in job configuration.
  ts = conf.getLong(ImportTsv.TIMESTAMP_CONF_KEY, 0);

  skipBadLines = context.getConfiguration().getBoolean(ImportTsv.SKIP_LINES_CONF_KEY, true);
  badLineCount = context.getCounter("ImportTsv", "Bad Lines");
  hfileOutPath = conf.get(ImportTsv.BULK_OUTPUT_CONF_KEY);
  indexedTable = conf.getBoolean(IndexMapReduceUtil.IS_INDEXED_TABLE, false);
}
 
开发者ID:tenggyut,项目名称:HIndex,代码行数:25,代码来源:IndexTsvImporterMapper.java

示例6: doSetup

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Handles common parameter initialization that a subclass might want to leverage.
 * @param context
 */
protected void doSetup(Context context) {
  Configuration conf = context.getConfiguration();

  // If a custom separator has been used,
  // decode it back from Base64 encoding.
  separator = conf.get(ImportTsv.SEPARATOR_CONF_KEY);
  if (separator == null) {
    separator = ImportTsv.DEFAULT_SEPARATOR;
  } else {
    separator = new String(Base64.decode(separator));
  }

  skipBadLines = context.getConfiguration().getBoolean(ImportTsv.SKIP_LINES_CONF_KEY, true);
  logBadLines = context.getConfiguration().getBoolean(ImportTsv.LOG_BAD_LINES_CONF_KEY, false);
  badLineCount = context.getCounter("ImportTsv", "Bad Lines");
}
 
开发者ID:apache,项目名称:hbase,代码行数:21,代码来源:TsvImporterTextMapper.java

示例7: doSetup

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Handles common parameter initialization that a subclass might want to leverage.
 * @param context
 */
protected void doSetup(Context context) {
  Configuration conf = context.getConfiguration();

  // If a custom separator has been used,
  // decode it back from Base64 encoding.
  separator = conf.get(ImportTsv.SEPARATOR_CONF_KEY);
  if (separator == null) {
    separator = ImportTsv.DEFAULT_SEPARATOR;
  } else {
    separator = new String(Base64.decode(separator));
  }
  // Should never get 0 as we are setting this to a valid value in job
  // configuration.
  ts = conf.getLong(ImportTsv.TIMESTAMP_CONF_KEY, 0);

  skipEmptyColumns = context.getConfiguration().getBoolean(
      ImportTsv.SKIP_EMPTY_COLUMNS, false);
  skipBadLines = context.getConfiguration().getBoolean(
      ImportTsv.SKIP_LINES_CONF_KEY, true);
  badLineCount = context.getCounter("ImportTsv", "Bad Lines");
  logBadLines = context.getConfiguration().getBoolean(ImportTsv.LOG_BAD_LINES_CONF_KEY, false);
  hfileOutPath = conf.get(ImportTsv.BULK_OUTPUT_CONF_KEY);
}
 
开发者ID:apache,项目名称:hbase,代码行数:28,代码来源:TsvImporterMapper.java

示例8: doSetup

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Handles common parameter initialization that a subclass might want to leverage.
 * @param context
 */
protected void doSetup(Context context) {
  Configuration conf = context.getConfiguration();

  // If a custom separator has been used,
  // decode it back from Base64 encoding.
  separator = conf.get(IndexImportTsv.SEPARATOR_CONF_KEY);
  if (separator == null) {
    separator = IndexImportTsv.DEFAULT_SEPARATOR;
  } else {
    separator = new String(Base64.decode(separator));
  }

  // Should never get 0 as we are setting this to a valid value in job configuration.
  ts = conf.getLong(IndexImportTsv.TIMESTAMP_CONF_KEY, 0);

  skipBadLines = context.getConfiguration().getBoolean(IndexImportTsv.SKIP_LINES_CONF_KEY, true);
  badLineCount = context.getCounter("ImportTsv", "Bad Lines");
  hfileOutPath = conf.get(IndexImportTsv.BULK_OUTPUT_CONF_KEY);
  indexedTable = conf.getBoolean(IndexMapReduceUtil.INDEX_IS_INDEXED_TABLE, false);
}
 
开发者ID:Huawei-Hadoop,项目名称:hindex,代码行数:25,代码来源:IndexTsvImporterMapper.java

示例9: convertStringToScan

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Converts the given Base64 string back into a Scan instance.
 *
 * @param base64  The scan details.
 * @return The newly created Scan instance.
 * @throws IOException When reading the scan instance fails.
 */
static Scan convertStringToScan(String base64) throws IOException {
  byte [] decoded = Base64.decode(base64);
  ClientProtos.Scan scan;
  try {
    scan = ClientProtos.Scan.parseFrom(decoded);
  } catch (InvalidProtocolBufferException ipbe) {
    throw new IOException(ipbe);
  }

  return ProtobufUtil.toScan(scan);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:19,代码来源:TableMapReduceUtil.java

示例10: getKeyFromConf

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
private static byte[] getKeyFromConf(Configuration conf,
    String base64Key, String deprecatedKey) {
  String encoded = conf.get(base64Key);
  if (encoded != null) {
    return Base64.decode(encoded);
  }
  String oldStyleVal = conf.get(deprecatedKey);
  if (oldStyleVal == null) {
    return null;
  }
  LOG.warn("Using deprecated configuration " + deprecatedKey +
      " - please use static accessor methods instead.");
  return Bytes.toBytes(oldStyleVal);
}
 
开发者ID:fengchen8086,项目名称:ditb,代码行数:15,代码来源:SimpleTotalOrderPartitioner.java

示例11: build

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

示例12: convertStringToScan

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Converts the given Base64 string back into a Scan instance.
 *
 * @param base64  The scan details.
 * @return The newly created Scan instance.
 * @throws IOException When reading the scan instance fails.
 */
static Scan convertStringToScan(String base64) throws IOException {
  ByteArrayInputStream bis = new ByteArrayInputStream(Base64.decode(base64));
  DataInputStream dis = new DataInputStream(bis);
  Scan scan = new Scan();
  scan.readFields(dis);
  return scan;
}
 
开发者ID:fengchen8086,项目名称:LCIndex-HBase-0.94.16,代码行数:15,代码来源:TableMapReduceUtil.java

示例13: getKeyFromConf

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
private static byte[] getKeyFromConf(Configuration conf,
    String base64Key, String deprecatedKey) {
  String encoded = conf.get(base64Key);
  if (encoded != null) {
    return Base64.decode(encoded);
  }
  String oldStyleVal = conf.get(deprecatedKey);
  if (oldStyleVal == null) {
    return null;
  }
  LOG.warn("Using deprecated configuration " + deprecatedKey +
      " - please use static accessor methods instead.");
  return Bytes.toBytesBinary(oldStyleVal);
}
 
开发者ID:apache,项目名称:hbase,代码行数:15,代码来源:SimpleTotalOrderPartitioner.java

示例14: build

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
public ByteArrayComparable build() {
  ByteArrayComparable comparator;
  switch (ComparatorType.valueOf(type)) {
    case BinaryComparator:
      comparator = new BinaryComparator(Base64.decode(value));
      break;
    case BinaryPrefixComparator:
      comparator = new BinaryPrefixComparator(Base64.decode(value));
      break;
    case BitComparator:
      comparator = new BitComparator(Base64.decode(value),
          BitComparator.BitwiseOp.valueOf(op));
      break;
    case NullComparator:
      comparator = new NullComparator();
      break;
    case RegexStringComparator:
      comparator = new RegexStringComparator(value);
      break;
    case SubstringComparator:
      comparator = new SubstringComparator(value);
      break;
    default:
      throw new RuntimeException("unhandled comparator type: " + type);
  }
  return comparator;
}
 
开发者ID:cloud-software-foundation,项目名称:c5,代码行数:28,代码来源:ScannerModel.java

示例15: convertStringToScan

import org.apache.hadoop.hbase.util.Base64; //导入方法依赖的package包/类
/**
 * Converts the given Base64 string back into a Scan instance.
 * 
 * @param base64
 *        The scan details.
 * @return The newly created Scan instance.
 * @throws IOException
 *         When reading the scan instance fails.
 */
public static Scan convertStringToScan(String base64) throws IOException {
	ByteArrayInputStream bis = new ByteArrayInputStream(Base64.decode(base64));
	DataInputStream dis = new DataInputStream(bis);
	Scan scan = new Scan();
	scan.readFields(dis);
	return scan;
}
 
开发者ID:citlab,项目名称:vs.msc.ws14,代码行数:17,代码来源:HBaseUtil.java


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