Package org.apache.hadoop.hbase.exceptions

Examples of org.apache.hadoop.hbase.exceptions.DeserializationException


  throws DeserializationException {
    FilterProtos.PrefixFilter proto;
    try {
      proto = FilterProtos.PrefixFilter.parseFrom(pbBytes);
    } catch (InvalidProtocolBufferException e) {
      throw new DeserializationException(e);
    }
    return new PrefixFilter(proto.hasPrefix()?proto.getPrefix().toByteArray():null);
  }
View Full Code Here


  throws DeserializationException {
    FilterProtos.InclusiveStopFilter proto;
    try {
      proto = FilterProtos.InclusiveStopFilter.parseFrom(pbBytes);
    } catch (InvalidProtocolBufferException e) {
      throw new DeserializationException(e);
    }
    return new InclusiveStopFilter(proto.hasStopRowKey()?proto.getStopRowKey().toByteArray():null);
  }
View Full Code Here

  throws DeserializationException {
    FilterProtos.DependentColumnFilter proto;
    try {
      proto = FilterProtos.DependentColumnFilter.parseFrom(pbBytes);
    } catch (InvalidProtocolBufferException e) {
      throw new DeserializationException(e);
    }
    final CompareOp valueCompareOp =
      CompareOp.valueOf(proto.getCompareFilter().getCompareOp().name());
    ByteArrayComparable valueComparator = null;
    try {
      if (proto.getCompareFilter().hasComparator()) {
        valueComparator = ProtobufUtil.toComparator(proto.getCompareFilter().getComparator());
      }
    } catch (IOException ioe) {
      throw new DeserializationException(ioe);
    }
    return new DependentColumnFilter(
      proto.hasColumnFamily()?proto.getColumnFamily().toByteArray():null,
      proto.hasColumnQualifier()?proto.getColumnQualifier().toByteArray():null,
      proto.getDropDependentColumn(), valueCompareOp, valueComparator);
View Full Code Here

  throws DeserializationException {
    FilterProtos.ColumnRangeFilter proto;
    try {
      proto = FilterProtos.ColumnRangeFilter.parseFrom(pbBytes);
    } catch (InvalidProtocolBufferException e) {
      throw new DeserializationException(e);
    }
    return new ColumnRangeFilter(proto.hasMinColumn()?proto.getMinColumn().toByteArray():null,
      proto.getMinColumnInclusive(),proto.hasMaxColumn()?proto.getMaxColumn().toByteArray():null,
      proto.getMaxColumnInclusive());
  }
View Full Code Here

   * @param bytes
   * @throws DeserializationException if we are missing the pb magic prefix
   */
  public static void expectPBMagicPrefix(final byte [] bytes) throws DeserializationException {
    if (!isPBMagicPrefix(bytes)) {
      throw new DeserializationException("Missing pb magic " + PB_MAGIC_STR + " prefix");
    }
  }
View Full Code Here

  throws DeserializationException {
    FilterProtos.MultipleColumnPrefixFilter proto;
    try {
      proto = FilterProtos.MultipleColumnPrefixFilter.parseFrom(pbBytes);
    } catch (InvalidProtocolBufferException e) {
      throw new DeserializationException(e);
    }
    int numPrefixes = proto.getSortedPrefixesCount();
    byte [][] prefixes = new byte[numPrefixes][];
    for (int i = 0; i < numPrefixes; ++i) {
      prefixes[i] = proto.getSortedPrefixes(i).toByteArray();
View Full Code Here

        HBaseProtos.RegionInfo ri =
            HBaseProtos.RegionInfo.newBuilder().
                mergeFrom(bytes, pblen + offset, len - pblen).build();
        return convert(ri);
      } catch (InvalidProtocolBufferException e) {
        throw new DeserializationException(e);
      }
    } else {
      try {
        HRegionInfo hri = new HRegionInfo();
        hri.readFields(bytes, offset, len);
        return hri;
      } catch (IOException e) {
        throw new DeserializationException(e);
      }
    }
  }
View Full Code Here

   * @throws DeserializationException
   * @see #toByteArray
   */
  public static ByteArrayComparable parseFrom(final byte [] pbBytes)
  throws DeserializationException {
    throw new DeserializationException(
      "parseFrom called on base ByteArrayComparable, but should be called on derived type");
  }
View Full Code Here

  throws DeserializationException {
    FilterProtos.InclusiveStopFilter proto;
    try {
      proto = FilterProtos.InclusiveStopFilter.parseFrom(pbBytes);
    } catch (InvalidProtocolBufferException e) {
      throw new DeserializationException(e);
    }
    return new InclusiveStopFilter(proto.hasStopRowKey()?proto.getStopRowKey().toByteArray():null);
  }
View Full Code Here

   * @return long - The current HLog position.
   * @throws DeserializationException
   */
  public static long parseHLogPositionFrom(final byte[] bytes) throws DeserializationException {
    if (bytes == null) {
      throw new DeserializationException("Unable to parse null HLog position.");
    }
    if (ProtobufUtil.isPBMagicPrefix(bytes)) {
      int pblen = ProtobufUtil.lengthOfPBMagic();
      ZooKeeperProtos.ReplicationHLogPosition.Builder builder =
          ZooKeeperProtos.ReplicationHLogPosition.newBuilder();
      ZooKeeperProtos.ReplicationHLogPosition position;
      try {
        position = builder.mergeFrom(bytes, pblen, bytes.length - pblen).build();
      } catch (InvalidProtocolBufferException e) {
        throw new DeserializationException(e);
      }
      return position.getPosition();
    } else {
      if (bytes.length > 0) {
        return Bytes.toLong(bytes);
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.exceptions.DeserializationException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.