Search in sources :

Example 1 with VersionInfo

use of org.apache.hadoop.hbase.util.VersionInfo in project hbase by apache.

the class ProtobufUtil method getVersionInfo.

/**
 * Get a protocol buffer VersionInfo
 *
 * @return the converted protocol buffer VersionInfo
 */
public static HBaseProtos.VersionInfo getVersionInfo() {
    HBaseProtos.VersionInfo.Builder builder = HBaseProtos.VersionInfo.newBuilder();
    String version = VersionInfo.getVersion();
    builder.setVersion(version);
    String[] components = version.split("\\.");
    if (components != null && components.length > 2) {
        builder.setVersionMajor(Integer.parseInt(components[0]));
        builder.setVersionMinor(Integer.parseInt(components[1]));
    }
    builder.setUrl(VersionInfo.getUrl());
    builder.setRevision(VersionInfo.getRevision());
    builder.setUser(VersionInfo.getUser());
    builder.setDate(VersionInfo.getDate());
    builder.setSrcChecksum(VersionInfo.getSrcChecksum());
    return builder.build();
}
Also used : VersionInfo(org.apache.hadoop.hbase.util.VersionInfo) ByteString(org.apache.hbase.thirdparty.com.google.protobuf.ByteString)

Aggregations

VersionInfo (org.apache.hadoop.hbase.util.VersionInfo)1 ByteString (org.apache.hbase.thirdparty.com.google.protobuf.ByteString)1