Java Code Examples for org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType#DELETE

The following examples show how to use org.apache.hadoop.hbase.protobuf.generated.ClientProtos.MutationProto.MutationType#DELETE . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: HBaseMutationCoder.java    From beam with Apache License 2.0 5 votes vote down vote up
private static MutationType getType(Mutation mutation) {
  if (mutation instanceof Put) {
    return MutationType.PUT;
  } else if (mutation instanceof Delete) {
    return MutationType.DELETE;
  } else {
    // Increment and Append are not idempotent.  They should not be used in distributed jobs.
    throw new IllegalArgumentException("Only Put and Delete are supported");
  }
}
 
Example 2
Source File: ProtobufUtil.java    From phoenix with Apache License 2.0 5 votes vote down vote up
public static MutationProto toProto(Mutation mutation) throws IOException {
    MutationType type;
    if (mutation instanceof Put) {
        type = MutationType.PUT;
    } else if (mutation instanceof Delete) {
        type = MutationType.DELETE;
    } else {
        throw new IllegalArgumentException("Only Put and Delete are supported");
    }
    return org.apache.hadoop.hbase.protobuf.ProtobufUtil.toMutation(type, mutation);
}
 
Example 3
Source File: StatisticsWriter.java    From phoenix with Apache License 2.0 5 votes vote down vote up
private static MutationType getMutationType(Mutation m) throws IOException {
    if (m instanceof Put) {
        return MutationType.PUT;
    } else if (m instanceof Delete) {
        return MutationType.DELETE;
    } else {
        throw new DoNotRetryIOException("Unsupported mutation type in stats commit"
                + m.getClass().getName());
    }
}
 
Example 4
Source File: ProtobufUtil.java    From phoenix with Apache License 2.0 5 votes vote down vote up
public static MutationProto toProto(Mutation mutation) throws IOException {
    MutationType type;
    if (mutation instanceof Put) {
        type = MutationType.PUT;
    } else if (mutation instanceof Delete) {
        type = MutationType.DELETE;
    } else {
        throw new IllegalArgumentException("Only Put and Delete are supported");
    }
    return org.apache.hadoop.hbase.protobuf.ProtobufUtil.toMutation(type, mutation);
}
 
Example 5
Source File: StatisticsWriter.java    From phoenix with Apache License 2.0 5 votes vote down vote up
private static MutationType getMutationType(Mutation m) throws IOException {
    if (m instanceof Put) {
        return MutationType.PUT;
    } else if (m instanceof Delete) {
        return MutationType.DELETE;
    } else {
        throw new DoNotRetryIOException("Unsupported mutation type in stats commit" + m.getClass().getName());
    }
}