File tree 4 files changed +11
-16
lines changed
main/java/com/alipay/oceanbase/rpc
protocol/payload/impl/execute/query
test/java/com/alipay/oceanbase/rpc/hbase 4 files changed +11
-16
lines changed Original file line number Diff line number Diff line change @@ -491,13 +491,12 @@ public void setScanRangeColumns(List<String> scanRangeColumns) {
491
491
this .scanRangeColumns = scanRangeColumns ;
492
492
}
493
493
494
- // This interface is just for OBKV-Hbase
495
- public void setObKVParams (ObKVParams obKVParams ) {
496
- if (!(obKVParams .getObParamsBase () instanceof ObHBaseParams )) {
497
- throw new FeatureNotSupportedException ("only ObHBaseParams support currently" );
494
+ public void setHBaseParams (ObHBaseParams obHBaseParams ) {
495
+ if (obKVParams == null ) {
496
+ this .obKVParams = new ObKVParams ();
498
497
}
498
+ this .obKVParams .setObParamsBase (obHBaseParams );
499
499
this .isHbaseQuery = true ;
500
- this .obKVParams = obKVParams ;
501
500
}
502
501
503
502
public ObKVParams getObKVParams () {
Original file line number Diff line number Diff line change @@ -33,6 +33,9 @@ public class ObHBaseParams extends ObKVParamsBase {
33
33
private static final int FLAG_IS_CACHE_BLOCK = 1 << 1 ;
34
34
private static final int FLAG_CHECK_EXISTENCE_ONLY = 1 << 2 ;
35
35
36
+ private static final int FLAG_BYTE_LENGTH = 1 ;
37
+ private static final int BOOLEAN_BYTE_LENGTH = 1 ; // all boolean to one byte
38
+
36
39
public ObHBaseParams () {
37
40
pType = paramType .HBase ;
38
41
}
@@ -61,11 +64,6 @@ public void setCheckExistenceOnly(boolean checkExistenceOnly) {
61
64
this .checkExistenceOnly = checkExistenceOnly ;
62
65
}
63
66
64
- private int getContentSize () {
65
- return 4 + Serialization .getNeedBytes (caching ) + Serialization .getNeedBytes (callTimeout )
66
- + 1 ;
67
- }
68
-
69
67
public int getCaching () {
70
68
return caching ;
71
69
}
@@ -134,8 +132,9 @@ public Object decode(ByteBuf buf) {
134
132
}
135
133
136
134
public long getPayloadContentSize () {
137
- return 1 + Serialization .getNeedBytes (caching ) + Serialization .getNeedBytes (callTimeout )
138
- + 1 ; // all boolean to one byte
135
+ return FLAG_BYTE_LENGTH
136
+ + Serialization .getNeedBytes (caching ) + Serialization .getNeedBytes (callTimeout )
137
+ + BOOLEAN_BYTE_LENGTH ;
139
138
}
140
139
141
140
public String toString () {
Original file line number Diff line number Diff line change @@ -33,7 +33,6 @@ public byte getValue() {
33
33
}
34
34
}
35
35
36
- public int byteSize ;
37
36
public paramType pType ;
38
37
39
38
public paramType getType () {
Original file line number Diff line number Diff line change @@ -116,9 +116,7 @@ public void setOperationType(ObTableOperationType operationType) {
116
116
117
117
public void setObKVParams (ObTableQuery query ) {
118
118
ObHBaseParams params = new ObHBaseParams ();
119
- ObKVParams obKVParams = new ObKVParams ();
120
- obKVParams .setObParamsBase (params );
121
- query .setObKVParams (obKVParams );
119
+ query .setHBaseParams (params );
122
120
}
123
121
124
122
public ObTableAbstractOperationRequest obTableOperationRequest () {
You can’t perform that action at this time.
0 commit comments