MCPcopy Create free account
hub / github.com/OpenTSDB/asynchbase / getPB

Method getPB

src/GetRequest.java:596–646  ·  view source on GitHub ↗

Generates the get request protobuf object. @return A Get Request protobuf builder object build from this RPC. @since 1.8

()

Source from the content-addressed store, hash-verified

594 * @since 1.8
595 */
596 ClientPB.Get.Builder getPB() {
597 final ClientPB.Get.Builder getpb = ClientPB.Get.newBuilder()
598 .setRow(Bytes.wrap(key));
599
600 if (family != null) {
601 final ClientPB.Column.Builder column = ClientPB.Column.newBuilder();
602 column.setFamily(Bytes.wrap(family));
603 if (qualifiers != null) {
604 for (final byte[] qualifier : qualifiers) {
605 column.addQualifier(Bytes.wrap(qualifier));
606 }
607 }
608 getpb.addColumn(column.build());
609 }
610
611 // Filters
612 if (filter != null) {
613 getpb.setFilter(FilterPB.Filter.newBuilder()
614 .setNameBytes(Bytes.wrap(filter.name()))
615 .setSerializedFilter(Bytes.wrap(filter.serialize()))
616 .build());
617 }
618
619 // TimeRange
620 final long min_ts = min_timestamp;
621 final long max_ts = max_timestamp;
622 if (min_ts != 0 || max_ts != Long.MAX_VALUE) {
623 final TimeRange.Builder time = TimeRange.newBuilder();
624 if (min_ts != 0) {
625 time.setFrom(min_ts);
626 }
627 if (max_ts != Long.MAX_VALUE) {
628 time.setTo(max_ts);
629 }
630 getpb.setTimeRange(time.build());
631 }
632
633 final int versions = maxVersions(); // Shadows this.versions
634 if (versions != 1) {
635 getpb.setMaxVersions(versions);
636 }
637 if (!isGetRequest()) {
638 getpb.setExistenceOnly(true);
639 }
640
641 if (!populate_blockcache) {
642 getpb.setCacheBlocks(false);
643 }
644
645 return getpb;
646 }
647
648 /** Serializes this request for HBase 0.94 and before. */
649 private ChannelBuffer serializeOld(final byte server_version) {

Callers 2

serializeMethod · 0.95
serializeMethod · 0.80

Calls 9

wrapMethod · 0.95
maxVersionsMethod · 0.95
isGetRequestMethod · 0.95
setFamilyMethod · 0.80
setMaxVersionsMethod · 0.80
setFilterMethod · 0.45
nameMethod · 0.45
serializeMethod · 0.45
setTimeRangeMethod · 0.45

Tested by

no test coverage detected