Java 类org.apache.hadoop.hbase.util.Base64 实例源码

项目:ditb    文件:TsvImporterTextMapper.java   
/**
 * 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");
}
项目:ditb    文件:TextSortReducer.java   
/**
 * 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");
}
项目:ditb    文件:TsvImporterMapper.java   
/**
 * 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);
}
项目:ditb    文件:ScannerModel.java   
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);
  }
}
项目:LCIndex-HBase-0.94.16    文件:ScannerModel.java   
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);
  }
}
项目:LCIndex-HBase-0.94.16    文件:TsvImporterMapper.java   
/**
 * 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");
}
项目:pbase    文件:TsvImporterTextMapper.java   
/**
 * 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");
}
项目:pbase    文件:TextSortReducer.java   
/**
 * 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");
}
项目:pbase    文件:TsvImporterMapper.java   
/**
 * 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);
}
项目:HIndex    文件:ScannerModel.java   
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);
  }
}
项目:HIndex    文件:TsvImporterTextMapper.java   
/**
 * 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");
}
项目:HIndex    文件:TextSortReducer.java   
/**
 * 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");
}
项目:HIndex    文件:TsvImporterMapper.java   
/**
 * 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);
}
项目:HIndex    文件:IndexTsvImporterMapper.java   
/**
 * 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);
}
项目:IRIndex    文件:ScannerModel.java   
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);
  }
}
项目:IRIndex    文件:TsvImporterMapper.java   
/**
 * 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");
}
项目:hbase    文件:TsvImporterTextMapper.java   
/**
 * 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");
}
项目:hbase    文件:TextSortReducer.java   
/**
 * Handles common parameter initialization that a subclass might want to leverage.
 * @param context
 * @param conf
 */
protected void doSetup(Context context, Configuration conf) {
  // 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");
}
项目:hbase    文件:TsvImporterMapper.java   
/**
 * 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);
}
项目:hbase    文件:ScannerModel.java   
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);
  }
}
项目:RStore    文件:ScannerModel.java   
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);
  }
}
项目:RStore    文件:TsvImporterMapper.java   
/**
 * 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));
  }

  ts = conf.getLong(ImportTsv.TIMESTAMP_CONF_KEY, System.currentTimeMillis());

  skipBadLines = context.getConfiguration().getBoolean(
      ImportTsv.SKIP_LINES_CONF_KEY, true);
  badLineCount = context.getCounter("ImportTsv", "Bad Lines");
}
项目:PyroDB    文件:ScannerModel.java   
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);
  }
}
项目:PyroDB    文件:TsvImporterTextMapper.java   
/**
 * 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");
}
项目:PyroDB    文件:TextSortReducer.java   
/**
 * 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");
}
项目:PyroDB    文件:TsvImporterMapper.java   
/**
 * 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);
}
项目:c5    文件:ScannerModel.java   
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);
  }
}
项目:c5    文件:TsvImporterTextMapper.java   
/**
 * 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");
}
项目:c5    文件:TextSortReducer.java   
/**
 * 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");
}
项目:c5    文件:TsvImporterMapper.java   
/**
 * 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");
}
项目:HBase-Research    文件:ScannerModel.java   
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);
  }
}
项目:HBase-Research    文件:TsvImporterMapper.java   
/**
 * 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");
}
项目:hbase-0.94.8-qod    文件:ScannerModel.java   
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);
  }
}
项目:hbase-0.94.8-qod    文件:TsvImporterMapper.java   
/**
 * 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");
}
项目:hbase-0.94.8-qod    文件:ScannerModel.java   
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);
  }
}
项目:hbase-0.94.8-qod    文件:TsvImporterMapper.java   
/**
 * 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");
}
项目:DominoHBase    文件:ScannerModel.java   
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);
  }
}
项目:DominoHBase    文件:TsvImporterMapper.java   
/**
 * 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");
}
项目:hindex    文件:IndexTsvImporterMapper.java   
/**
 * 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);
}
项目:hindex    文件:ScannerModel.java   
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);
  }
}