public Object getFieldValue(_Fields field) { switch (field) { case START_KEY: return getStart_key(); case END_KEY: return getEnd_key(); } throw new IllegalStateException(); }
public BlockletBTreeIndex deepCopy() { return new BlockletBTreeIndex(this); }
public void setFieldValue(_Fields field, Object value) { switch (field) { case START_KEY: if (value == null) { unsetStart_key(); } else { setStart_key((ByteBuffer)value); } break; case END_KEY: if (value == null) { unsetEnd_key(); } else { setEnd_key((ByteBuffer)value); } break; } }
/** Returns true if field corresponding to fieldID is set (has been assigned a value) and false otherwise */ public boolean isSet(_Fields field) { if (field == null) { throw new IllegalArgumentException(); } switch (field) { case START_KEY: return isSetStart_key(); case END_KEY: return isSetEnd_key(); } throw new IllegalStateException(); }
public static BlockletIndex getBlockletIndex( org.apache.carbondata.core.metadata.blocklet.index.BlockletIndex info) { BlockletMinMaxIndex blockletMinMaxIndex = convertMinMaxIndex(info.getMinMaxIndex()); BlockletBTreeIndex blockletBTreeIndex = new BlockletBTreeIndex(); blockletBTreeIndex.setStart_key(info.getBtreeIndex().getStartKey()); blockletBTreeIndex.setEnd_key(info.getBtreeIndex().getEndKey()); BlockletIndex blockletIndex = new BlockletIndex(); blockletIndex.setMin_max_index(blockletMinMaxIndex); blockletIndex.setB_tree_index(blockletBTreeIndex); return blockletIndex; }
@Override public void read(org.apache.thrift.protocol.TProtocol prot, BlockletIndex struct) throws org.apache.thrift.TException { TTupleProtocol iprot = (TTupleProtocol) prot; BitSet incoming = iprot.readBitSet(2); if (incoming.get(0)) { struct.min_max_index = new BlockletMinMaxIndex(); struct.min_max_index.read(iprot); struct.setMin_max_indexIsSet(true); } if (incoming.get(1)) { struct.b_tree_index = new BlockletBTreeIndex(); struct.b_tree_index.read(iprot); struct.setB_tree_indexIsSet(true); } } }
public byte[] getEnd_key() { setEnd_key(org.apache.thrift.TBaseHelper.rightSize(end_key)); return end_key == null ? null : end_key.array(); }
public byte[] getStart_key() { setStart_key(org.apache.thrift.TBaseHelper.rightSize(start_key)); return start_key == null ? null : start_key.array(); }
@Override public boolean equals(Object that) { if (that == null) return false; if (that instanceof BlockletBTreeIndex) return this.equals((BlockletBTreeIndex)that); return false; }
private void readObject(java.io.ObjectInputStream in) throws java.io.IOException, ClassNotFoundException { try { read(new org.apache.thrift.protocol.TCompactProtocol(new org.apache.thrift.transport.TIOStreamTransport(in))); } catch (org.apache.thrift.TException te) { throw new java.io.IOException(te); } }
blockletMinMaxIndex.addToMin_values(ByteBuffer.wrap(min)); BlockletBTreeIndex blockletBTreeIndex = new BlockletBTreeIndex(); byte[] startKey = encodedBlocklet.getPageMetadataList().get(0).serializeStartKey(); blockletBTreeIndex.setStart_key(startKey); byte[] endKey = encodedBlocklet.getPageMetadataList().get(encodedBlocklet.getPageMetadataList().size() - 1) .serializeEndKey(); blockletBTreeIndex.setEnd_key(endKey); BlockletIndex blockletIndex = new BlockletIndex(); blockletIndex.setMin_max_index(blockletMinMaxIndex);
public boolean equals(BlockletBTreeIndex that) { if (that == null) return false; boolean this_present_start_key = true && this.isSetStart_key(); boolean that_present_start_key = true && that.isSetStart_key(); if (this_present_start_key || that_present_start_key) { if (!(this_present_start_key && that_present_start_key)) return false; if (!this.start_key.equals(that.start_key)) return false; } boolean this_present_end_key = true && this.isSetEnd_key(); boolean that_present_end_key = true && that.isSetEnd_key(); if (this_present_end_key || that_present_end_key) { if (!(this_present_end_key && that_present_end_key)) return false; if (!this.end_key.equals(that.end_key)) return false; } return true; }
case 2: // B_TREE_INDEX if (schemeField.type == org.apache.thrift.protocol.TType.STRUCT) { struct.b_tree_index = new BlockletBTreeIndex(); struct.b_tree_index.read(iprot); struct.setB_tree_indexIsSet(true); } else {
public boolean equals(BlockletIndex that) { if (that == null) return false; boolean this_present_min_max_index = true && this.isSetMin_max_index(); boolean that_present_min_max_index = true && that.isSetMin_max_index(); if (this_present_min_max_index || that_present_min_max_index) { if (!(this_present_min_max_index && that_present_min_max_index)) return false; if (!this.min_max_index.equals(that.min_max_index)) return false; } boolean this_present_b_tree_index = true && this.isSetB_tree_index(); boolean that_present_b_tree_index = true && that.isSetB_tree_index(); if (this_present_b_tree_index || that_present_b_tree_index) { if (!(this_present_b_tree_index && that_present_b_tree_index)) return false; if (!this.b_tree_index.equals(that.b_tree_index)) return false; } return true; }
/** * Below method will be used to convert the blocklet index of thrift to * wrapper * * @param blockletIndexThrift * @return blocklet index wrapper */ protected BlockletIndex getBlockletIndex( org.apache.carbondata.format.BlockletIndex blockletIndexThrift) { org.apache.carbondata.format.BlockletBTreeIndex btreeIndex = blockletIndexThrift.getB_tree_index(); org.apache.carbondata.format.BlockletMinMaxIndex minMaxIndex = blockletIndexThrift.getMin_max_index(); List<Boolean> isMinMaxSet = null; // Below logic is added to handle backward compatibility if (minMaxIndex.isSetMin_max_presence()) { isMinMaxSet = minMaxIndex.getMin_max_presence(); } else { Boolean[] minMaxFlag = new Boolean[minMaxIndex.getMax_values().size()]; Arrays.fill(minMaxFlag, true); isMinMaxSet = Arrays.asList(minMaxFlag); } return new BlockletIndex( new BlockletBTreeIndex(btreeIndex.getStart_key(), btreeIndex.getEnd_key()), new BlockletMinMaxIndex(minMaxIndex.getMin_values(), minMaxIndex.getMax_values(), isMinMaxSet)); }
@Override public int hashCode() { List<Object> list = new ArrayList<Object>(); boolean present_start_key = true && (isSetStart_key()); list.add(present_start_key); if (present_start_key) list.add(start_key); boolean present_end_key = true && (isSetEnd_key()); list.add(present_end_key); if (present_end_key) list.add(end_key); return list.hashCode(); }
/** * Performs a deep copy on <i>other</i>. */ public BlockletIndex(BlockletIndex other) { if (other.isSetMin_max_index()) { this.min_max_index = new BlockletMinMaxIndex(other.min_max_index); } if (other.isSetB_tree_index()) { this.b_tree_index = new BlockletBTreeIndex(other.b_tree_index); } }
BlockletInfo blockletInfo = converterV3.getBlockletInfo(blockletInfo3, model.getSegmentProperties().getDimensions().size()); BlockletBTreeIndex bTreeIndex = new BlockletBTreeIndex(index.b_tree_index.getStart_key(), index.b_tree_index.getEnd_key()); BlockletMinMaxIndex minMaxIndex = new BlockletMinMaxIndex(index.getMin_max_index().getMin_values(),
/** * Performs a deep copy on <i>other</i>. */ public BlockletBTreeIndex(BlockletBTreeIndex other) { if (other.isSetStart_key()) { this.start_key = org.apache.thrift.TBaseHelper.copyBinary(other.start_key); } if (other.isSetEnd_key()) { this.end_key = org.apache.thrift.TBaseHelper.copyBinary(other.end_key); } }
@Override public int compareTo(BlockletBTreeIndex other) { if (!getClass().equals(other.getClass())) { return getClass().getName().compareTo(other.getClass().getName()); } int lastComparison = 0; lastComparison = Boolean.valueOf(isSetStart_key()).compareTo(other.isSetStart_key()); if (lastComparison != 0) { return lastComparison; } if (isSetStart_key()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.start_key, other.start_key); if (lastComparison != 0) { return lastComparison; } } lastComparison = Boolean.valueOf(isSetEnd_key()).compareTo(other.isSetEnd_key()); if (lastComparison != 0) { return lastComparison; } if (isSetEnd_key()) { lastComparison = org.apache.thrift.TBaseHelper.compareTo(this.end_key, other.end_key); if (lastComparison != 0) { return lastComparison; } } return 0; }