HBASE-822 Update thrift README and HBase.thrift to use thrift 20080411
git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@686572 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
b32989b25c
commit
5580255c08
|
@ -0,0 +1,173 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Autogenerated by Thrift
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
*/
|
||||
package org.apache.hadoop.hbase.thrift.generated;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import com.facebook.thrift.*;
|
||||
|
||||
import com.facebook.thrift.protocol.*;
|
||||
import com.facebook.thrift.transport.*;
|
||||
|
||||
/**
|
||||
* TCell - Used to transport a cell value (byte[]) and the timestamp it was
|
||||
* stored with together as a result for get and getRow methods. This promotes
|
||||
* the timestamp of a cell to a first-class value, making it easy to take
|
||||
* note of temporal data. Cell is used all the way from HStore up to HTable.
|
||||
*/
|
||||
public class TCell implements TBase, java.io.Serializable {
|
||||
public byte[] value;
|
||||
public long timestamp;
|
||||
|
||||
public final Isset __isset = new Isset();
|
||||
public static final class Isset implements java.io.Serializable {
|
||||
public boolean value = false;
|
||||
public boolean timestamp = false;
|
||||
}
|
||||
|
||||
public TCell() {
|
||||
}
|
||||
|
||||
public TCell(
|
||||
byte[] value,
|
||||
long timestamp)
|
||||
{
|
||||
this();
|
||||
this.value = value;
|
||||
this.__isset.value = true;
|
||||
this.timestamp = timestamp;
|
||||
this.__isset.timestamp = true;
|
||||
}
|
||||
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TCell)
|
||||
return this.equals((TCell)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TCell that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_value = true && (this.value != null);
|
||||
boolean that_present_value = true && (that.value != null);
|
||||
if (this_present_value || that_present_value) {
|
||||
if (!(this_present_value && that_present_value))
|
||||
return false;
|
||||
if (!java.util.Arrays.equals(this.value, that.value))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_timestamp = true;
|
||||
boolean that_present_timestamp = true;
|
||||
if (this_present_timestamp || that_present_timestamp) {
|
||||
if (!(this_present_timestamp && that_present_timestamp))
|
||||
return false;
|
||||
if (this.timestamp != that.timestamp)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void read(TProtocol iprot) throws TException {
|
||||
TField field;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
field = iprot.readFieldBegin();
|
||||
if (field.type == TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (field.id)
|
||||
{
|
||||
case 1:
|
||||
if (field.type == TType.STRING) {
|
||||
this.value = iprot.readBinary();
|
||||
this.__isset.value = true;
|
||||
} else {
|
||||
TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (field.type == TType.I64) {
|
||||
this.timestamp = iprot.readI64();
|
||||
this.__isset.timestamp = true;
|
||||
} else {
|
||||
TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
TProtocolUtil.skip(iprot, field.type);
|
||||
break;
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
}
|
||||
|
||||
public void write(TProtocol oprot) throws TException {
|
||||
TStruct struct = new TStruct("TCell");
|
||||
oprot.writeStructBegin(struct);
|
||||
TField field = new TField();
|
||||
if (this.value != null) {
|
||||
field.name = "value";
|
||||
field.type = TType.STRING;
|
||||
field.id = 1;
|
||||
oprot.writeFieldBegin(field);
|
||||
oprot.writeBinary(this.value);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
field.name = "timestamp";
|
||||
field.type = TType.I64;
|
||||
field.id = 2;
|
||||
oprot.writeFieldBegin(field);
|
||||
oprot.writeI64(this.timestamp);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("TCell(");
|
||||
sb.append("value:");
|
||||
sb.append(this.value);
|
||||
sb.append(",timestamp:");
|
||||
sb.append(this.timestamp);
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,264 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Autogenerated by Thrift
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
*/
|
||||
package org.apache.hadoop.hbase.thrift.generated;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import com.facebook.thrift.*;
|
||||
|
||||
import com.facebook.thrift.protocol.*;
|
||||
import com.facebook.thrift.transport.*;
|
||||
|
||||
/**
|
||||
* A TRegionInfo contains information about an HTable region.
|
||||
*/
|
||||
public class TRegionInfo implements TBase, java.io.Serializable {
|
||||
public byte[] startKey;
|
||||
public byte[] endKey;
|
||||
public long id;
|
||||
public byte[] name;
|
||||
public byte version;
|
||||
|
||||
public final Isset __isset = new Isset();
|
||||
public static final class Isset implements java.io.Serializable {
|
||||
public boolean startKey = false;
|
||||
public boolean endKey = false;
|
||||
public boolean id = false;
|
||||
public boolean name = false;
|
||||
public boolean version = false;
|
||||
}
|
||||
|
||||
public TRegionInfo() {
|
||||
}
|
||||
|
||||
public TRegionInfo(
|
||||
byte[] startKey,
|
||||
byte[] endKey,
|
||||
long id,
|
||||
byte[] name,
|
||||
byte version)
|
||||
{
|
||||
this();
|
||||
this.startKey = startKey;
|
||||
this.__isset.startKey = true;
|
||||
this.endKey = endKey;
|
||||
this.__isset.endKey = true;
|
||||
this.id = id;
|
||||
this.__isset.id = true;
|
||||
this.name = name;
|
||||
this.__isset.name = true;
|
||||
this.version = version;
|
||||
this.__isset.version = true;
|
||||
}
|
||||
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TRegionInfo)
|
||||
return this.equals((TRegionInfo)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TRegionInfo that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_startKey = true && (this.startKey != null);
|
||||
boolean that_present_startKey = true && (that.startKey != null);
|
||||
if (this_present_startKey || that_present_startKey) {
|
||||
if (!(this_present_startKey && that_present_startKey))
|
||||
return false;
|
||||
if (!java.util.Arrays.equals(this.startKey, that.startKey))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_endKey = true && (this.endKey != null);
|
||||
boolean that_present_endKey = true && (that.endKey != null);
|
||||
if (this_present_endKey || that_present_endKey) {
|
||||
if (!(this_present_endKey && that_present_endKey))
|
||||
return false;
|
||||
if (!java.util.Arrays.equals(this.endKey, that.endKey))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_id = true;
|
||||
boolean that_present_id = true;
|
||||
if (this_present_id || that_present_id) {
|
||||
if (!(this_present_id && that_present_id))
|
||||
return false;
|
||||
if (this.id != that.id)
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_name = true && (this.name != null);
|
||||
boolean that_present_name = true && (that.name != null);
|
||||
if (this_present_name || that_present_name) {
|
||||
if (!(this_present_name && that_present_name))
|
||||
return false;
|
||||
if (!java.util.Arrays.equals(this.name, that.name))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_version = true;
|
||||
boolean that_present_version = true;
|
||||
if (this_present_version || that_present_version) {
|
||||
if (!(this_present_version && that_present_version))
|
||||
return false;
|
||||
if (this.version != that.version)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void read(TProtocol iprot) throws TException {
|
||||
TField field;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
field = iprot.readFieldBegin();
|
||||
if (field.type == TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (field.id)
|
||||
{
|
||||
case 1:
|
||||
if (field.type == TType.STRING) {
|
||||
this.startKey = iprot.readBinary();
|
||||
this.__isset.startKey = true;
|
||||
} else {
|
||||
TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (field.type == TType.STRING) {
|
||||
this.endKey = iprot.readBinary();
|
||||
this.__isset.endKey = true;
|
||||
} else {
|
||||
TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (field.type == TType.I64) {
|
||||
this.id = iprot.readI64();
|
||||
this.__isset.id = true;
|
||||
} else {
|
||||
TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (field.type == TType.STRING) {
|
||||
this.name = iprot.readBinary();
|
||||
this.__isset.name = true;
|
||||
} else {
|
||||
TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 5:
|
||||
if (field.type == TType.BYTE) {
|
||||
this.version = iprot.readByte();
|
||||
this.__isset.version = true;
|
||||
} else {
|
||||
TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
TProtocolUtil.skip(iprot, field.type);
|
||||
break;
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
}
|
||||
|
||||
public void write(TProtocol oprot) throws TException {
|
||||
TStruct struct = new TStruct("TRegionInfo");
|
||||
oprot.writeStructBegin(struct);
|
||||
TField field = new TField();
|
||||
if (this.startKey != null) {
|
||||
field.name = "startKey";
|
||||
field.type = TType.STRING;
|
||||
field.id = 1;
|
||||
oprot.writeFieldBegin(field);
|
||||
oprot.writeBinary(this.startKey);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (this.endKey != null) {
|
||||
field.name = "endKey";
|
||||
field.type = TType.STRING;
|
||||
field.id = 2;
|
||||
oprot.writeFieldBegin(field);
|
||||
oprot.writeBinary(this.endKey);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
field.name = "id";
|
||||
field.type = TType.I64;
|
||||
field.id = 3;
|
||||
oprot.writeFieldBegin(field);
|
||||
oprot.writeI64(this.id);
|
||||
oprot.writeFieldEnd();
|
||||
if (this.name != null) {
|
||||
field.name = "name";
|
||||
field.type = TType.STRING;
|
||||
field.id = 4;
|
||||
oprot.writeFieldBegin(field);
|
||||
oprot.writeBinary(this.name);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
field.name = "version";
|
||||
field.type = TType.BYTE;
|
||||
field.id = 5;
|
||||
oprot.writeFieldBegin(field);
|
||||
oprot.writeByte(this.version);
|
||||
oprot.writeFieldEnd();
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("TRegionInfo(");
|
||||
sb.append("startKey:");
|
||||
sb.append(this.startKey);
|
||||
sb.append(",endKey:");
|
||||
sb.append(this.endKey);
|
||||
sb.append(",id:");
|
||||
sb.append(this.id);
|
||||
sb.append(",name:");
|
||||
sb.append(this.name);
|
||||
sb.append(",version:");
|
||||
sb.append(this.version);
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,192 @@
|
|||
/**
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Autogenerated by Thrift
|
||||
*
|
||||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
|
||||
*/
|
||||
package org.apache.hadoop.hbase.thrift.generated;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Map;
|
||||
import java.util.HashMap;
|
||||
import java.util.Set;
|
||||
import java.util.HashSet;
|
||||
import com.facebook.thrift.*;
|
||||
|
||||
import com.facebook.thrift.protocol.*;
|
||||
import com.facebook.thrift.transport.*;
|
||||
|
||||
/**
|
||||
* Holds row name and then a map of columns to cells.
|
||||
*/
|
||||
public class TRowResult implements TBase, java.io.Serializable {
|
||||
public byte[] row;
|
||||
public Map<byte[],TCell> columns;
|
||||
|
||||
public final Isset __isset = new Isset();
|
||||
public static final class Isset implements java.io.Serializable {
|
||||
public boolean row = false;
|
||||
public boolean columns = false;
|
||||
}
|
||||
|
||||
public TRowResult() {
|
||||
}
|
||||
|
||||
public TRowResult(
|
||||
byte[] row,
|
||||
Map<byte[],TCell> columns)
|
||||
{
|
||||
this();
|
||||
this.row = row;
|
||||
this.__isset.row = true;
|
||||
this.columns = columns;
|
||||
this.__isset.columns = true;
|
||||
}
|
||||
|
||||
public boolean equals(Object that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
if (that instanceof TRowResult)
|
||||
return this.equals((TRowResult)that);
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean equals(TRowResult that) {
|
||||
if (that == null)
|
||||
return false;
|
||||
|
||||
boolean this_present_row = true && (this.row != null);
|
||||
boolean that_present_row = true && (that.row != null);
|
||||
if (this_present_row || that_present_row) {
|
||||
if (!(this_present_row && that_present_row))
|
||||
return false;
|
||||
if (!java.util.Arrays.equals(this.row, that.row))
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean this_present_columns = true && (this.columns != null);
|
||||
boolean that_present_columns = true && (that.columns != null);
|
||||
if (this_present_columns || that_present_columns) {
|
||||
if (!(this_present_columns && that_present_columns))
|
||||
return false;
|
||||
if (!this.columns.equals(that.columns))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public int hashCode() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void read(TProtocol iprot) throws TException {
|
||||
TField field;
|
||||
iprot.readStructBegin();
|
||||
while (true)
|
||||
{
|
||||
field = iprot.readFieldBegin();
|
||||
if (field.type == TType.STOP) {
|
||||
break;
|
||||
}
|
||||
switch (field.id)
|
||||
{
|
||||
case 1:
|
||||
if (field.type == TType.STRING) {
|
||||
this.row = iprot.readBinary();
|
||||
this.__isset.row = true;
|
||||
} else {
|
||||
TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (field.type == TType.MAP) {
|
||||
{
|
||||
TMap _map4 = iprot.readMapBegin();
|
||||
this.columns = new HashMap<byte[],TCell>(2*_map4.size);
|
||||
for (int _i5 = 0; _i5 < _map4.size; ++_i5)
|
||||
{
|
||||
byte[] _key6;
|
||||
TCell _val7;
|
||||
_key6 = iprot.readBinary();
|
||||
_val7 = new TCell();
|
||||
_val7.read(iprot);
|
||||
this.columns.put(_key6, _val7);
|
||||
}
|
||||
iprot.readMapEnd();
|
||||
}
|
||||
this.__isset.columns = true;
|
||||
} else {
|
||||
TProtocolUtil.skip(iprot, field.type);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
TProtocolUtil.skip(iprot, field.type);
|
||||
break;
|
||||
}
|
||||
iprot.readFieldEnd();
|
||||
}
|
||||
iprot.readStructEnd();
|
||||
}
|
||||
|
||||
public void write(TProtocol oprot) throws TException {
|
||||
TStruct struct = new TStruct("TRowResult");
|
||||
oprot.writeStructBegin(struct);
|
||||
TField field = new TField();
|
||||
if (this.row != null) {
|
||||
field.name = "row";
|
||||
field.type = TType.STRING;
|
||||
field.id = 1;
|
||||
oprot.writeFieldBegin(field);
|
||||
oprot.writeBinary(this.row);
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
if (this.columns != null) {
|
||||
field.name = "columns";
|
||||
field.type = TType.MAP;
|
||||
field.id = 2;
|
||||
oprot.writeFieldBegin(field);
|
||||
{
|
||||
oprot.writeMapBegin(new TMap(TType.STRING, TType.STRUCT, this.columns.size()));
|
||||
for (byte[] _iter8 : this.columns.keySet()) {
|
||||
oprot.writeBinary(_iter8);
|
||||
this.columns.get(_iter8).write(oprot);
|
||||
}
|
||||
oprot.writeMapEnd();
|
||||
}
|
||||
oprot.writeFieldEnd();
|
||||
}
|
||||
oprot.writeFieldStop();
|
||||
oprot.writeStructEnd();
|
||||
}
|
||||
|
||||
public String toString() {
|
||||
StringBuilder sb = new StringBuilder("TRowResult(");
|
||||
sb.append("row:");
|
||||
sb.append(this.row);
|
||||
sb.append(",columns:");
|
||||
sb.append(this.columns);
|
||||
sb.append(")");
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue