Guest User

Untitled

a guest
May 5th, 2009
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 35.92 KB | None | 0 0
  1. Index: Hbase.thrift
  2. ===================================================================
  3. --- Hbase.thrift (revision 771922)
  4. +++ Hbase.thrift (working copy)
  5. @@ -523,6 +523,9 @@
  6. list<TRowResult> scannerGet(1:ScannerID id)
  7. throws (1:IOError io, 2:IllegalArgument ia)
  8.  
  9. + list<TRowResult> scannerGetList(1:ScannerID id,2:i32 nbRows)
  10. + throws (1:IOError io, 2:IllegalArgument ia)
  11. +
  12. /**
  13. * Closes the server-state associated with an open scanner.
  14. *
  15. Index: ThriftServer.java
  16. ===================================================================
  17. --- ThriftServer.java (revision 771922)
  18. +++ ThriftServer.java (working copy)
  19. @@ -440,6 +440,25 @@
  20. removeScanner(id);
  21. }
  22.  
  23. + public List<TRowResult> scannerGetList(int id, int nbRows) throws IllegalArgument, IOError {
  24. + LOG.debug("scannerGet: id=" + id);
  25. + Scanner scanner = getScanner(id);
  26. + if (scanner == null) {
  27. + throw new IllegalArgument("scanner ID is invalid");
  28. + }
  29. +
  30. + RowResult [] results = null;
  31. +
  32. + try {
  33. + results = scanner.next(nbRows);
  34. + if (results == null) {
  35. + return new ArrayList<TRowResult>();
  36. + }
  37. + } catch (IOException e) {
  38. + throw new IOError(e.getMessage());
  39. + }
  40. + return ThriftUtilities.rowResultFromHBase(results);
  41. + }
  42. public List<TRowResult> scannerGet(int id) throws IllegalArgument,
  43. IOError {
  44. LOG.debug("scannerGet: id=" + id);
  45. Index: ThriftUtilities.java
  46. ===================================================================
  47. --- ThriftUtilities.java (revision 771922)
  48. +++ ThriftUtilities.java (working copy)
  49. @@ -123,6 +123,28 @@
  50. * Hbase RowResult object
  51. * @return Thrift TRowResult array
  52. */
  53. + static public List<TRowResult> rowResultFromHBase(RowResult[] in) {
  54. + List<TRowResult> results = new ArrayList<TRowResult>();
  55. + for ( RowResult result_ : in) {
  56. + if(null == result_) {
  57. + continue;
  58. + }
  59. + TRowResult result = new TRowResult();
  60. + result.row = result_.getRow();
  61. + result.columns = new TreeMap<byte[], TCell>(Bytes.BYTES_COMPARATOR);
  62. + for (Map.Entry<byte[], Cell> entry : result_.entrySet()){
  63. + Cell cell = entry.getValue();
  64. + result.columns.put(entry.getKey(),
  65. + new TCell(cell.getValue(), cell.getTimestamp()));
  66. +
  67. + }
  68. + results.add(result);
  69. + }
  70. + if (0 == results.size() ) {
  71. + return null;
  72. + }
  73. + return results;
  74. + }
  75. static public List<TRowResult> rowResultFromHBase(RowResult in) {
  76. List<TRowResult> list = new ArrayList<TRowResult>();
  77. if(in == null) {
  78. Index: generated/Mutation.java
  79. ===================================================================
  80. --- generated/Mutation.java (revision 771922)
  81. +++ generated/Mutation.java (working copy)
  82. @@ -1,21 +1,4 @@
  83. /**
  84. - * Licensed to the Apache Software Foundation (ASF) under one
  85. - * or more contributor license agreements. See the NOTICE file
  86. - * distributed with this work for additional information
  87. - * regarding copyright ownership. The ASF licenses this file
  88. - * to you under the Apache License, Version 2.0 (the
  89. - * "License"); you may not use this file except in compliance
  90. - * with the License. You may obtain a copy of the License at
  91. - *
  92. - * http://www.apache.org/licenses/LICENSE-2.0
  93. - *
  94. - * Unless required by applicable law or agreed to in writing, software
  95. - * distributed under the License is distributed on an "AS IS" BASIS,
  96. - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  97. - * See the License for the specific language governing permissions and
  98. - * limitations under the License.
  99. - */
  100. -/**
  101. * Autogenerated by Thrift
  102. *
  103. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  104. Index: generated/AlreadyExists.java
  105. ===================================================================
  106. --- generated/AlreadyExists.java (revision 771922)
  107. +++ generated/AlreadyExists.java (working copy)
  108. @@ -1,21 +1,4 @@
  109. /**
  110. - * Licensed to the Apache Software Foundation (ASF) under one
  111. - * or more contributor license agreements. See the NOTICE file
  112. - * distributed with this work for additional information
  113. - * regarding copyright ownership. The ASF licenses this file
  114. - * to you under the Apache License, Version 2.0 (the
  115. - * "License"); you may not use this file except in compliance
  116. - * with the License. You may obtain a copy of the License at
  117. - *
  118. - * http://www.apache.org/licenses/LICENSE-2.0
  119. - *
  120. - * Unless required by applicable law or agreed to in writing, software
  121. - * distributed under the License is distributed on an "AS IS" BASIS,
  122. - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  123. - * See the License for the specific language governing permissions and
  124. - * limitations under the License.
  125. - */
  126. -/**
  127. * Autogenerated by Thrift
  128. *
  129. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  130. Index: generated/IOError.java
  131. ===================================================================
  132. --- generated/IOError.java (revision 771922)
  133. +++ generated/IOError.java (working copy)
  134. @@ -1,21 +1,4 @@
  135. /**
  136. - * Licensed to the Apache Software Foundation (ASF) under one
  137. - * or more contributor license agreements. See the NOTICE file
  138. - * distributed with this work for additional information
  139. - * regarding copyright ownership. The ASF licenses this file
  140. - * to you under the Apache License, Version 2.0 (the
  141. - * "License"); you may not use this file except in compliance
  142. - * with the License. You may obtain a copy of the License at
  143. - *
  144. - * http://www.apache.org/licenses/LICENSE-2.0
  145. - *
  146. - * Unless required by applicable law or agreed to in writing, software
  147. - * distributed under the License is distributed on an "AS IS" BASIS,
  148. - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  149. - * See the License for the specific language governing permissions and
  150. - * limitations under the License.
  151. - */
  152. -/**
  153. * Autogenerated by Thrift
  154. *
  155. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  156. Index: generated/BatchMutation.java
  157. ===================================================================
  158. --- generated/BatchMutation.java (revision 771922)
  159. +++ generated/BatchMutation.java (working copy)
  160. @@ -1,21 +1,4 @@
  161. /**
  162. - * Licensed to the Apache Software Foundation (ASF) under one
  163. - * or more contributor license agreements. See the NOTICE file
  164. - * distributed with this work for additional information
  165. - * regarding copyright ownership. The ASF licenses this file
  166. - * to you under the Apache License, Version 2.0 (the
  167. - * "License"); you may not use this file except in compliance
  168. - * with the License. You may obtain a copy of the License at
  169. - *
  170. - * http://www.apache.org/licenses/LICENSE-2.0
  171. - *
  172. - * Unless required by applicable law or agreed to in writing, software
  173. - * distributed under the License is distributed on an "AS IS" BASIS,
  174. - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  175. - * See the License for the specific language governing permissions and
  176. - * limitations under the License.
  177. - */
  178. -/**
  179. * Autogenerated by Thrift
  180. *
  181. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  182. Index: generated/Hbase.java
  183. ===================================================================
  184. --- generated/Hbase.java (revision 771922)
  185. +++ generated/Hbase.java (working copy)
  186. @@ -1,21 +1,4 @@
  187. /**
  188. - * Licensed to the Apache Software Foundation (ASF) under one
  189. - * or more contributor license agreements. See the NOTICE file
  190. - * distributed with this work for additional information
  191. - * regarding copyright ownership. The ASF licenses this file
  192. - * to you under the Apache License, Version 2.0 (the
  193. - * "License"); you may not use this file except in compliance
  194. - * with the License. You may obtain a copy of the License at
  195. - *
  196. - * http://www.apache.org/licenses/LICENSE-2.0
  197. - *
  198. - * Unless required by applicable law or agreed to in writing, software
  199. - * distributed under the License is distributed on an "AS IS" BASIS,
  200. - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  201. - * See the License for the specific language governing permissions and
  202. - * limitations under the License.
  203. - */
  204. -/**
  205. * Autogenerated by Thrift
  206. *
  207. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  208. @@ -466,6 +449,8 @@
  209. */
  210. public List<TRowResult> scannerGet(int id) throws IOError, IllegalArgument, TException;
  211.  
  212. + public List<TRowResult> scannerGetList(int id, int nbRows) throws IOError, IllegalArgument, TException;
  213. +
  214. /**
  215. * Closes the server-state associated with an open scanner.
  216. *
  217. @@ -1651,6 +1636,46 @@
  218. throw new TApplicationException(TApplicationException.MISSING_RESULT, "scannerGet failed: unknown result");
  219. }
  220.  
  221. + public List<TRowResult> scannerGetList(int id, int nbRows) throws IOError, IllegalArgument, TException
  222. + {
  223. + send_scannerGetList(id, nbRows);
  224. + return recv_scannerGetList();
  225. + }
  226. +
  227. + public void send_scannerGetList(int id, int nbRows) throws TException
  228. + {
  229. + oprot_.writeMessageBegin(new TMessage("scannerGetList", TMessageType.CALL, seqid_));
  230. + scannerGetList_args args = new scannerGetList_args();
  231. + args.id = id;
  232. + args.nbRows = nbRows;
  233. + args.write(oprot_);
  234. + oprot_.writeMessageEnd();
  235. + oprot_.getTransport().flush();
  236. + }
  237. +
  238. + public List<TRowResult> recv_scannerGetList() throws IOError, IllegalArgument, TException
  239. + {
  240. + TMessage msg = iprot_.readMessageBegin();
  241. + if (msg.type == TMessageType.EXCEPTION) {
  242. + TApplicationException x = TApplicationException.read(iprot_);
  243. + iprot_.readMessageEnd();
  244. + throw x;
  245. + }
  246. + scannerGetList_result result = new scannerGetList_result();
  247. + result.read(iprot_);
  248. + iprot_.readMessageEnd();
  249. + if (result.isSetSuccess()) {
  250. + return result.success;
  251. + }
  252. + if (result.io != null) {
  253. + throw result.io;
  254. + }
  255. + if (result.ia != null) {
  256. + throw result.ia;
  257. + }
  258. + throw new TApplicationException(TApplicationException.MISSING_RESULT, "scannerGetList failed: unknown result");
  259. + }
  260. +
  261. public void scannerClose(int id) throws IOError, IllegalArgument, TException
  262. {
  263. send_scannerClose(id);
  264. @@ -1723,6 +1748,7 @@
  265. processMap_.put("scannerOpenTs", new scannerOpenTs());
  266. processMap_.put("scannerOpenWithStopTs", new scannerOpenWithStopTs());
  267. processMap_.put("scannerGet", new scannerGet());
  268. + processMap_.put("scannerGetList", new scannerGetList());
  269. processMap_.put("scannerClose", new scannerClose());
  270. }
  271.  
  272. @@ -2393,6 +2419,28 @@
  273.  
  274. }
  275.  
  276. + private class scannerGetList implements ProcessFunction {
  277. + public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
  278. + {
  279. + scannerGetList_args args = new scannerGetList_args();
  280. + args.read(iprot);
  281. + iprot.readMessageEnd();
  282. + scannerGetList_result result = new scannerGetList_result();
  283. + try {
  284. + result.success = iface_.scannerGetList(args.id, args.nbRows);
  285. + } catch (IOError io) {
  286. + result.io = io;
  287. + } catch (IllegalArgument ia) {
  288. + result.ia = ia;
  289. + }
  290. + oprot.writeMessageBegin(new TMessage("scannerGetList", TMessageType.REPLY, seqid));
  291. + result.write(oprot);
  292. + oprot.writeMessageEnd();
  293. + oprot.getTransport().flush();
  294. + }
  295. +
  296. + }
  297. +
  298. private class scannerClose implements ProcessFunction {
  299. public void process(int seqid, TProtocol iprot, TProtocol oprot) throws TException
  300. {
  301. @@ -20936,6 +20984,655 @@
  302.  
  303. }
  304.  
  305. + public static class scannerGetList_args implements TBase, java.io.Serializable, Cloneable {
  306. + private static final TStruct STRUCT_DESC = new TStruct("scannerGetList_args");
  307. + private static final TField ID_FIELD_DESC = new TField("id", TType.I32, (short)1);
  308. + private static final TField NB_ROWS_FIELD_DESC = new TField("nbRows", TType.I32, (short)2);
  309. +
  310. + public int id;
  311. + public static final int ID = 1;
  312. + public int nbRows;
  313. + public static final int NBROWS = 2;
  314. +
  315. + private final Isset __isset = new Isset();
  316. + private static final class Isset implements java.io.Serializable {
  317. + public boolean id = false;
  318. + public boolean nbRows = false;
  319. + }
  320. +
  321. + public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
  322. + put(ID, new FieldMetaData("id", TFieldRequirementType.DEFAULT,
  323. + new FieldValueMetaData(TType.I32)));
  324. + put(NBROWS, new FieldMetaData("nbRows", TFieldRequirementType.DEFAULT,
  325. + new FieldValueMetaData(TType.I32)));
  326. + }});
  327. +
  328. + static {
  329. + FieldMetaData.addStructMetaDataMap(scannerGetList_args.class, metaDataMap);
  330. + }
  331. +
  332. + public scannerGetList_args() {
  333. + }
  334. +
  335. + public scannerGetList_args(
  336. + int id,
  337. + int nbRows)
  338. + {
  339. + this();
  340. + this.id = id;
  341. + this.__isset.id = true;
  342. + this.nbRows = nbRows;
  343. + this.__isset.nbRows = true;
  344. + }
  345. +
  346. + /**
  347. + * Performs a deep copy on <i>other</i>.
  348. + */
  349. + public scannerGetList_args(scannerGetList_args other) {
  350. + __isset.id = other.__isset.id;
  351. + this.id = other.id;
  352. + __isset.nbRows = other.__isset.nbRows;
  353. + this.nbRows = other.nbRows;
  354. + }
  355. +
  356. + @Override
  357. + public scannerGetList_args clone() {
  358. + return new scannerGetList_args(this);
  359. + }
  360. +
  361. + public int getId() {
  362. + return this.id;
  363. + }
  364. +
  365. + public void setId(int id) {
  366. + this.id = id;
  367. + this.__isset.id = true;
  368. + }
  369. +
  370. + public void unsetId() {
  371. + this.__isset.id = false;
  372. + }
  373. +
  374. + // Returns true if field id is set (has been asigned a value) and false otherwise
  375. + public boolean isSetId() {
  376. + return this.__isset.id;
  377. + }
  378. +
  379. + public void setIdIsSet(boolean value) {
  380. + this.__isset.id = value;
  381. + }
  382. +
  383. + public int getNbRows() {
  384. + return this.nbRows;
  385. + }
  386. +
  387. + public void setNbRows(int nbRows) {
  388. + this.nbRows = nbRows;
  389. + this.__isset.nbRows = true;
  390. + }
  391. +
  392. + public void unsetNbRows() {
  393. + this.__isset.nbRows = false;
  394. + }
  395. +
  396. + // Returns true if field nbRows is set (has been asigned a value) and false otherwise
  397. + public boolean isSetNbRows() {
  398. + return this.__isset.nbRows;
  399. + }
  400. +
  401. + public void setNbRowsIsSet(boolean value) {
  402. + this.__isset.nbRows = value;
  403. + }
  404. +
  405. + public void setFieldValue(int fieldID, Object value) {
  406. + switch (fieldID) {
  407. + case ID:
  408. + if (value == null) {
  409. + unsetId();
  410. + } else {
  411. + setId((Integer)value);
  412. + }
  413. + break;
  414. +
  415. + case NBROWS:
  416. + if (value == null) {
  417. + unsetNbRows();
  418. + } else {
  419. + setNbRows((Integer)value);
  420. + }
  421. + break;
  422. +
  423. + default:
  424. + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
  425. + }
  426. + }
  427. +
  428. + public Object getFieldValue(int fieldID) {
  429. + switch (fieldID) {
  430. + case ID:
  431. + return new Integer(getId());
  432. +
  433. + case NBROWS:
  434. + return new Integer(getNbRows());
  435. +
  436. + default:
  437. + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
  438. + }
  439. + }
  440. +
  441. + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
  442. + public boolean isSet(int fieldID) {
  443. + switch (fieldID) {
  444. + case ID:
  445. + return isSetId();
  446. + case NBROWS:
  447. + return isSetNbRows();
  448. + default:
  449. + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
  450. + }
  451. + }
  452. +
  453. + @Override
  454. + public boolean equals(Object that) {
  455. + if (that == null)
  456. + return false;
  457. + if (that instanceof scannerGetList_args)
  458. + return this.equals((scannerGetList_args)that);
  459. + return false;
  460. + }
  461. +
  462. + public boolean equals(scannerGetList_args that) {
  463. + if (that == null)
  464. + return false;
  465. +
  466. + boolean this_present_id = true;
  467. + boolean that_present_id = true;
  468. + if (this_present_id || that_present_id) {
  469. + if (!(this_present_id && that_present_id))
  470. + return false;
  471. + if (this.id != that.id)
  472. + return false;
  473. + }
  474. +
  475. + boolean this_present_nbRows = true;
  476. + boolean that_present_nbRows = true;
  477. + if (this_present_nbRows || that_present_nbRows) {
  478. + if (!(this_present_nbRows && that_present_nbRows))
  479. + return false;
  480. + if (this.nbRows != that.nbRows)
  481. + return false;
  482. + }
  483. +
  484. + return true;
  485. + }
  486. +
  487. + @Override
  488. + public int hashCode() {
  489. + return 0;
  490. + }
  491. +
  492. + public void read(TProtocol iprot) throws TException {
  493. + TField field;
  494. + iprot.readStructBegin();
  495. + while (true)
  496. + {
  497. + field = iprot.readFieldBegin();
  498. + if (field.type == TType.STOP) {
  499. + break;
  500. + }
  501. + switch (field.id)
  502. + {
  503. + case ID:
  504. + if (field.type == TType.I32) {
  505. + this.id = iprot.readI32();
  506. + this.__isset.id = true;
  507. + } else {
  508. + TProtocolUtil.skip(iprot, field.type);
  509. + }
  510. + break;
  511. + case NBROWS:
  512. + if (field.type == TType.I32) {
  513. + this.nbRows = iprot.readI32();
  514. + this.__isset.nbRows = true;
  515. + } else {
  516. + TProtocolUtil.skip(iprot, field.type);
  517. + }
  518. + break;
  519. + default:
  520. + TProtocolUtil.skip(iprot, field.type);
  521. + break;
  522. + }
  523. + iprot.readFieldEnd();
  524. + }
  525. + iprot.readStructEnd();
  526. +
  527. +
  528. + // check for required fields of primitive type, which can't be checked in the validate method
  529. + validate();
  530. + }
  531. +
  532. + public void write(TProtocol oprot) throws TException {
  533. + validate();
  534. +
  535. + oprot.writeStructBegin(STRUCT_DESC);
  536. + oprot.writeFieldBegin(ID_FIELD_DESC);
  537. + oprot.writeI32(this.id);
  538. + oprot.writeFieldEnd();
  539. + oprot.writeFieldBegin(NB_ROWS_FIELD_DESC);
  540. + oprot.writeI32(this.nbRows);
  541. + oprot.writeFieldEnd();
  542. + oprot.writeFieldStop();
  543. + oprot.writeStructEnd();
  544. + }
  545. +
  546. + @Override
  547. + public String toString() {
  548. + StringBuilder sb = new StringBuilder("scannerGetList_args(");
  549. + boolean first = true;
  550. +
  551. + sb.append("id:");
  552. + sb.append(this.id);
  553. + first = false;
  554. + if (!first) sb.append(", ");
  555. + sb.append("nbRows:");
  556. + sb.append(this.nbRows);
  557. + first = false;
  558. + sb.append(")");
  559. + return sb.toString();
  560. + }
  561. +
  562. + public void validate() throws TException {
  563. + // check for required fields
  564. + // check that fields of type enum have valid values
  565. + }
  566. +
  567. + }
  568. +
  569. + public static class scannerGetList_result implements TBase, java.io.Serializable, Cloneable {
  570. + private static final TStruct STRUCT_DESC = new TStruct("scannerGetList_result");
  571. + private static final TField SUCCESS_FIELD_DESC = new TField("success", TType.LIST, (short)0);
  572. + private static final TField IO_FIELD_DESC = new TField("io", TType.STRUCT, (short)1);
  573. + private static final TField IA_FIELD_DESC = new TField("ia", TType.STRUCT, (short)2);
  574. +
  575. + public List<TRowResult> success;
  576. + public static final int SUCCESS = 0;
  577. + public IOError io;
  578. + public static final int IO = 1;
  579. + public IllegalArgument ia;
  580. + public static final int IA = 2;
  581. +
  582. + private final Isset __isset = new Isset();
  583. + private static final class Isset implements java.io.Serializable {
  584. + }
  585. +
  586. + public static final Map<Integer, FieldMetaData> metaDataMap = Collections.unmodifiableMap(new HashMap<Integer, FieldMetaData>() {{
  587. + put(SUCCESS, new FieldMetaData("success", TFieldRequirementType.DEFAULT,
  588. + new ListMetaData(TType.LIST,
  589. + new StructMetaData(TType.STRUCT, TRowResult.class))));
  590. + put(IO, new FieldMetaData("io", TFieldRequirementType.DEFAULT,
  591. + new FieldValueMetaData(TType.STRUCT)));
  592. + put(IA, new FieldMetaData("ia", TFieldRequirementType.DEFAULT,
  593. + new FieldValueMetaData(TType.STRUCT)));
  594. + }});
  595. +
  596. + static {
  597. + FieldMetaData.addStructMetaDataMap(scannerGetList_result.class, metaDataMap);
  598. + }
  599. +
  600. + public scannerGetList_result() {
  601. + }
  602. +
  603. + public scannerGetList_result(
  604. + List<TRowResult> success,
  605. + IOError io,
  606. + IllegalArgument ia)
  607. + {
  608. + this();
  609. + this.success = success;
  610. + this.io = io;
  611. + this.ia = ia;
  612. + }
  613. +
  614. + /**
  615. + * Performs a deep copy on <i>other</i>.
  616. + */
  617. + public scannerGetList_result(scannerGetList_result other) {
  618. + if (other.isSetSuccess()) {
  619. + List<TRowResult> __this__success = new ArrayList<TRowResult>();
  620. + for (TRowResult other_element : other.success) {
  621. + __this__success.add(new TRowResult(other_element));
  622. + }
  623. + this.success = __this__success;
  624. + }
  625. + if (other.isSetIo()) {
  626. + this.io = new IOError(other.io);
  627. + }
  628. + if (other.isSetIa()) {
  629. + this.ia = new IllegalArgument(other.ia);
  630. + }
  631. + }
  632. +
  633. + @Override
  634. + public scannerGetList_result clone() {
  635. + return new scannerGetList_result(this);
  636. + }
  637. +
  638. + public int getSuccessSize() {
  639. + return (this.success == null) ? 0 : this.success.size();
  640. + }
  641. +
  642. + public java.util.Iterator<TRowResult> getSuccessIterator() {
  643. + return (this.success == null) ? null : this.success.iterator();
  644. + }
  645. +
  646. + public void addToSuccess(TRowResult elem) {
  647. + if (this.success == null) {
  648. + this.success = new ArrayList<TRowResult>();
  649. + }
  650. + this.success.add(elem);
  651. + }
  652. +
  653. + public List<TRowResult> getSuccess() {
  654. + return this.success;
  655. + }
  656. +
  657. + public void setSuccess(List<TRowResult> success) {
  658. + this.success = success;
  659. + }
  660. +
  661. + public void unsetSuccess() {
  662. + this.success = null;
  663. + }
  664. +
  665. + // Returns true if field success is set (has been asigned a value) and false otherwise
  666. + public boolean isSetSuccess() {
  667. + return this.success != null;
  668. + }
  669. +
  670. + public void setSuccessIsSet(boolean value) {
  671. + if (!value) {
  672. + this.success = null;
  673. + }
  674. + }
  675. +
  676. + public IOError getIo() {
  677. + return this.io;
  678. + }
  679. +
  680. + public void setIo(IOError io) {
  681. + this.io = io;
  682. + }
  683. +
  684. + public void unsetIo() {
  685. + this.io = null;
  686. + }
  687. +
  688. + // Returns true if field io is set (has been asigned a value) and false otherwise
  689. + public boolean isSetIo() {
  690. + return this.io != null;
  691. + }
  692. +
  693. + public void setIoIsSet(boolean value) {
  694. + if (!value) {
  695. + this.io = null;
  696. + }
  697. + }
  698. +
  699. + public IllegalArgument getIa() {
  700. + return this.ia;
  701. + }
  702. +
  703. + public void setIa(IllegalArgument ia) {
  704. + this.ia = ia;
  705. + }
  706. +
  707. + public void unsetIa() {
  708. + this.ia = null;
  709. + }
  710. +
  711. + // Returns true if field ia is set (has been asigned a value) and false otherwise
  712. + public boolean isSetIa() {
  713. + return this.ia != null;
  714. + }
  715. +
  716. + public void setIaIsSet(boolean value) {
  717. + if (!value) {
  718. + this.ia = null;
  719. + }
  720. + }
  721. +
  722. + public void setFieldValue(int fieldID, Object value) {
  723. + switch (fieldID) {
  724. + case SUCCESS:
  725. + if (value == null) {
  726. + unsetSuccess();
  727. + } else {
  728. + setSuccess((List<TRowResult>)value);
  729. + }
  730. + break;
  731. +
  732. + case IO:
  733. + if (value == null) {
  734. + unsetIo();
  735. + } else {
  736. + setIo((IOError)value);
  737. + }
  738. + break;
  739. +
  740. + case IA:
  741. + if (value == null) {
  742. + unsetIa();
  743. + } else {
  744. + setIa((IllegalArgument)value);
  745. + }
  746. + break;
  747. +
  748. + default:
  749. + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
  750. + }
  751. + }
  752. +
  753. + public Object getFieldValue(int fieldID) {
  754. + switch (fieldID) {
  755. + case SUCCESS:
  756. + return getSuccess();
  757. +
  758. + case IO:
  759. + return getIo();
  760. +
  761. + case IA:
  762. + return getIa();
  763. +
  764. + default:
  765. + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
  766. + }
  767. + }
  768. +
  769. + // Returns true if field corresponding to fieldID is set (has been asigned a value) and false otherwise
  770. + public boolean isSet(int fieldID) {
  771. + switch (fieldID) {
  772. + case SUCCESS:
  773. + return isSetSuccess();
  774. + case IO:
  775. + return isSetIo();
  776. + case IA:
  777. + return isSetIa();
  778. + default:
  779. + throw new IllegalArgumentException("Field " + fieldID + " doesn't exist!");
  780. + }
  781. + }
  782. +
  783. + @Override
  784. + public boolean equals(Object that) {
  785. + if (that == null)
  786. + return false;
  787. + if (that instanceof scannerGetList_result)
  788. + return this.equals((scannerGetList_result)that);
  789. + return false;
  790. + }
  791. +
  792. + public boolean equals(scannerGetList_result that) {
  793. + if (that == null)
  794. + return false;
  795. +
  796. + boolean this_present_success = true && this.isSetSuccess();
  797. + boolean that_present_success = true && that.isSetSuccess();
  798. + if (this_present_success || that_present_success) {
  799. + if (!(this_present_success && that_present_success))
  800. + return false;
  801. + if (!this.success.equals(that.success))
  802. + return false;
  803. + }
  804. +
  805. + boolean this_present_io = true && this.isSetIo();
  806. + boolean that_present_io = true && that.isSetIo();
  807. + if (this_present_io || that_present_io) {
  808. + if (!(this_present_io && that_present_io))
  809. + return false;
  810. + if (!this.io.equals(that.io))
  811. + return false;
  812. + }
  813. +
  814. + boolean this_present_ia = true && this.isSetIa();
  815. + boolean that_present_ia = true && that.isSetIa();
  816. + if (this_present_ia || that_present_ia) {
  817. + if (!(this_present_ia && that_present_ia))
  818. + return false;
  819. + if (!this.ia.equals(that.ia))
  820. + return false;
  821. + }
  822. +
  823. + return true;
  824. + }
  825. +
  826. + @Override
  827. + public int hashCode() {
  828. + return 0;
  829. + }
  830. +
  831. + public void read(TProtocol iprot) throws TException {
  832. + TField field;
  833. + iprot.readStructBegin();
  834. + while (true)
  835. + {
  836. + field = iprot.readFieldBegin();
  837. + if (field.type == TType.STOP) {
  838. + break;
  839. + }
  840. + switch (field.id)
  841. + {
  842. + case SUCCESS:
  843. + if (field.type == TType.LIST) {
  844. + {
  845. + TList _list98 = iprot.readListBegin();
  846. + this.success = new ArrayList<TRowResult>(_list98.size);
  847. + for (int _i99 = 0; _i99 < _list98.size; ++_i99)
  848. + {
  849. + TRowResult _elem100;
  850. + _elem100 = new TRowResult();
  851. + _elem100.read(iprot);
  852. + this.success.add(_elem100);
  853. + }
  854. + iprot.readListEnd();
  855. + }
  856. + } else {
  857. + TProtocolUtil.skip(iprot, field.type);
  858. + }
  859. + break;
  860. + case IO:
  861. + if (field.type == TType.STRUCT) {
  862. + this.io = new IOError();
  863. + this.io.read(iprot);
  864. + } else {
  865. + TProtocolUtil.skip(iprot, field.type);
  866. + }
  867. + break;
  868. + case IA:
  869. + if (field.type == TType.STRUCT) {
  870. + this.ia = new IllegalArgument();
  871. + this.ia.read(iprot);
  872. + } else {
  873. + TProtocolUtil.skip(iprot, field.type);
  874. + }
  875. + break;
  876. + default:
  877. + TProtocolUtil.skip(iprot, field.type);
  878. + break;
  879. + }
  880. + iprot.readFieldEnd();
  881. + }
  882. + iprot.readStructEnd();
  883. +
  884. +
  885. + // check for required fields of primitive type, which can't be checked in the validate method
  886. + validate();
  887. + }
  888. +
  889. + public void write(TProtocol oprot) throws TException {
  890. + oprot.writeStructBegin(STRUCT_DESC);
  891. +
  892. + if (this.isSetSuccess()) {
  893. + oprot.writeFieldBegin(SUCCESS_FIELD_DESC);
  894. + {
  895. + oprot.writeListBegin(new TList(TType.STRUCT, this.success.size()));
  896. + for (TRowResult _iter101 : this.success) {
  897. + _iter101.write(oprot);
  898. + }
  899. + oprot.writeListEnd();
  900. + }
  901. + oprot.writeFieldEnd();
  902. + } else if (this.isSetIo()) {
  903. + oprot.writeFieldBegin(IO_FIELD_DESC);
  904. + this.io.write(oprot);
  905. + oprot.writeFieldEnd();
  906. + } else if (this.isSetIa()) {
  907. + oprot.writeFieldBegin(IA_FIELD_DESC);
  908. + this.ia.write(oprot);
  909. + oprot.writeFieldEnd();
  910. + }
  911. + oprot.writeFieldStop();
  912. + oprot.writeStructEnd();
  913. + }
  914. +
  915. + @Override
  916. + public String toString() {
  917. + StringBuilder sb = new StringBuilder("scannerGetList_result(");
  918. + boolean first = true;
  919. +
  920. + sb.append("success:");
  921. + if (this.success == null) {
  922. + sb.append("null");
  923. + } else {
  924. + sb.append(this.success);
  925. + }
  926. + first = false;
  927. + if (!first) sb.append(", ");
  928. + sb.append("io:");
  929. + if (this.io == null) {
  930. + sb.append("null");
  931. + } else {
  932. + sb.append(this.io);
  933. + }
  934. + first = false;
  935. + if (!first) sb.append(", ");
  936. + sb.append("ia:");
  937. + if (this.ia == null) {
  938. + sb.append("null");
  939. + } else {
  940. + sb.append(this.ia);
  941. + }
  942. + first = false;
  943. + sb.append(")");
  944. + return sb.toString();
  945. + }
  946. +
  947. + public void validate() throws TException {
  948. + // check for required fields
  949. + // check that fields of type enum have valid values
  950. + }
  951. +
  952. + }
  953. +
  954. public static class scannerClose_args implements TBase, java.io.Serializable, Cloneable {
  955. private static final TStruct STRUCT_DESC = new TStruct("scannerClose_args");
  956. private static final TField ID_FIELD_DESC = new TField("id", TType.I32, (short)1);
  957. Index: generated/TCell.java
  958. ===================================================================
  959. --- generated/TCell.java (revision 771922)
  960. +++ generated/TCell.java (working copy)
  961. @@ -1,21 +1,4 @@
  962. /**
  963. - * Licensed to the Apache Software Foundation (ASF) under one
  964. - * or more contributor license agreements. See the NOTICE file
  965. - * distributed with this work for additional information
  966. - * regarding copyright ownership. The ASF licenses this file
  967. - * to you under the Apache License, Version 2.0 (the
  968. - * "License"); you may not use this file except in compliance
  969. - * with the License. You may obtain a copy of the License at
  970. - *
  971. - * http://www.apache.org/licenses/LICENSE-2.0
  972. - *
  973. - * Unless required by applicable law or agreed to in writing, software
  974. - * distributed under the License is distributed on an "AS IS" BASIS,
  975. - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  976. - * See the License for the specific language governing permissions and
  977. - * limitations under the License.
  978. - */
  979. -/**
  980. * Autogenerated by Thrift
  981. *
  982. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  983. Index: generated/TRegionInfo.java
  984. ===================================================================
  985. --- generated/TRegionInfo.java (revision 771922)
  986. +++ generated/TRegionInfo.java (working copy)
  987. @@ -1,21 +1,4 @@
  988. /**
  989. - * Licensed to the Apache Software Foundation (ASF) under one
  990. - * or more contributor license agreements. See the NOTICE file
  991. - * distributed with this work for additional information
  992. - * regarding copyright ownership. The ASF licenses this file
  993. - * to you under the Apache License, Version 2.0 (the
  994. - * "License"); you may not use this file except in compliance
  995. - * with the License. You may obtain a copy of the License at
  996. - *
  997. - * http://www.apache.org/licenses/LICENSE-2.0
  998. - *
  999. - * Unless required by applicable law or agreed to in writing, software
  1000. - * distributed under the License is distributed on an "AS IS" BASIS,
  1001. - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1002. - * See the License for the specific language governing permissions and
  1003. - * limitations under the License.
  1004. - */
  1005. -/**
  1006. * Autogenerated by Thrift
  1007. *
  1008. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  1009. Index: generated/TRowResult.java
  1010. ===================================================================
  1011. --- generated/TRowResult.java (revision 771922)
  1012. +++ generated/TRowResult.java (working copy)
  1013. @@ -1,21 +1,4 @@
  1014. /**
  1015. - * Licensed to the Apache Software Foundation (ASF) under one
  1016. - * or more contributor license agreements. See the NOTICE file
  1017. - * distributed with this work for additional information
  1018. - * regarding copyright ownership. The ASF licenses this file
  1019. - * to you under the Apache License, Version 2.0 (the
  1020. - * "License"); you may not use this file except in compliance
  1021. - * with the License. You may obtain a copy of the License at
  1022. - *
  1023. - * http://www.apache.org/licenses/LICENSE-2.0
  1024. - *
  1025. - * Unless required by applicable law or agreed to in writing, software
  1026. - * distributed under the License is distributed on an "AS IS" BASIS,
  1027. - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1028. - * See the License for the specific language governing permissions and
  1029. - * limitations under the License.
  1030. - */
  1031. -/**
  1032. * Autogenerated by Thrift
  1033. *
  1034. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  1035. Index: generated/ColumnDescriptor.java
  1036. ===================================================================
  1037. --- generated/ColumnDescriptor.java (revision 771922)
  1038. +++ generated/ColumnDescriptor.java (working copy)
  1039. @@ -1,21 +1,4 @@
  1040. /**
  1041. - * Licensed to the Apache Software Foundation (ASF) under one
  1042. - * or more contributor license agreements. See the NOTICE file
  1043. - * distributed with this work for additional information
  1044. - * regarding copyright ownership. The ASF licenses this file
  1045. - * to you under the Apache License, Version 2.0 (the
  1046. - * "License"); you may not use this file except in compliance
  1047. - * with the License. You may obtain a copy of the License at
  1048. - *
  1049. - * http://www.apache.org/licenses/LICENSE-2.0
  1050. - *
  1051. - * Unless required by applicable law or agreed to in writing, software
  1052. - * distributed under the License is distributed on an "AS IS" BASIS,
  1053. - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1054. - * See the License for the specific language governing permissions and
  1055. - * limitations under the License.
  1056. - */
  1057. -/**
  1058. * Autogenerated by Thrift
  1059. *
  1060. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
  1061. Index: generated/IllegalArgument.java
  1062. ===================================================================
  1063. --- generated/IllegalArgument.java (revision 771922)
  1064. +++ generated/IllegalArgument.java (working copy)
  1065. @@ -1,21 +1,4 @@
  1066. /**
  1067. - * Licensed to the Apache Software Foundation (ASF) under one
  1068. - * or more contributor license agreements. See the NOTICE file
  1069. - * distributed with this work for additional information
  1070. - * regarding copyright ownership. The ASF licenses this file
  1071. - * to you under the Apache License, Version 2.0 (the
  1072. - * "License"); you may not use this file except in compliance
  1073. - * with the License. You may obtain a copy of the License at
  1074. - *
  1075. - * http://www.apache.org/licenses/LICENSE-2.0
  1076. - *
  1077. - * Unless required by applicable law or agreed to in writing, software
  1078. - * distributed under the License is distributed on an "AS IS" BASIS,
  1079. - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  1080. - * See the License for the specific language governing permissions and
  1081. - * limitations under the License.
  1082. - */
  1083. -/**
  1084. * Autogenerated by Thrift
  1085. *
  1086. * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
Advertisement
Add Comment
Please, Sign In to add comment