Package org.apache.hadoop.hbase.exceptions

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


   * @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.FamilyFilter proto;
    try {
      proto = FilterProtos.FamilyFilter.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 FamilyFilter(valueCompareOp,valueComparator);
  }
View Full Code Here

  throws DeserializationException {
    FilterProtos.FirstKeyValueMatchingQualifiersFilter proto;
    try {
      proto = FilterProtos.FirstKeyValueMatchingQualifiersFilter.parseFrom(pbBytes);
    } catch (InvalidProtocolBufferException e) {
      throw new DeserializationException(e);
    }

    TreeSet<byte []> qualifiers = new TreeSet<byte []>(Bytes.BYTES_COMPARATOR);
    for (ByteString qualifier : proto.getQualifiersList()) {
      qualifiers.add(qualifier.toByteArray());
View Full Code Here

   * @throws DeserializationException
   * @throws IOException in case an I/O or an filter specific failure needs to be signaled.
   * @see #toByteArray
   */
  public static Filter parseFrom(final byte [] pbBytes) throws DeserializationException {
    throw new DeserializationException(
      "parseFrom called on base Filter, but should be called on derived type");
  }
View Full Code Here

  throws DeserializationException {
    ComparatorProtos.BitComparator proto;
    try {
      proto = ComparatorProtos.BitComparator.parseFrom(pbBytes);
    } catch (InvalidProtocolBufferException e) {
      throw new DeserializationException(e);
    }
    BitwiseOp bitwiseOp = BitwiseOp.valueOf(proto.getBitwiseOp().name());
    return new BitComparator(proto.getComparable().getValue().toByteArray(),bitwiseOp);
  }
View Full Code Here

    TableSchema.Builder builder = TableSchema.newBuilder();
    TableSchema ts;
    try {
      ts = builder.mergeFrom(bytes, pblen, bytes.length - pblen).build();
    } catch (InvalidProtocolBufferException e) {
      throw new DeserializationException(e);
    }
    return convert(ts);
  }
View Full Code Here

        // A failed parse of the znode is pretty catastrophic. Rather than loop
        // retrying hoping the bad bytes will changes, and rather than change
        // the signature on this method to add an IOE which will send ripples all
        // over the code base, throw a RuntimeException.  This should "never" happen.
        // Fail fast if it does.
        throw new DeserializationException(e);
      }
    }
    // The str returned could be old style -- pre hbase-1502 -- which was
    // hostname and port seperated by a colon rather than hostname, port and
    // startcode delimited by a ','.
View Full Code Here

      int prefixLen = ProtobufUtil.lengthOfPBMagic();
      ZooKeeperProtos.RegionTransition rt = ZooKeeperProtos.RegionTransition.newBuilder().
        mergeFrom(data, prefixLen, data.length - prefixLen).build();
      return new RegionTransition(rt);
    } catch (InvalidProtocolBufferException e) {
      throw new DeserializationException(e);
    }
  }
View Full Code Here

    try {
      fileContent = builder.mergeFrom(bytes, pblen, bytes.length - pblen).build();
      return fileContent.getVersion();
    } catch (InvalidProtocolBufferException e) {
      // Convert
      throw new DeserializationException(e);
    }
  }
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

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.