public BTreeSMGetWithByteTypeBkey(List<String> keyList, byte[] from, byte[] to, ElementFlagFilter eFlagFilter, int count, SMGetMode smgetMode) { this.keyList = keyList; this.range = BTreeUtil.toHex(from) + ".." + BTreeUtil.toHex(to); this.eFlagFilter = eFlagFilter; this.count = count; this.smgetMode = smgetMode; this.reverse = BTreeUtil.compareByteArraysInLexOrder(from, to) > 0; }
public void decodeItemHeader(String itemHeader) { String[] splited = itemHeader.split(" "); if (splited.length == 3) { // ELEMENT <bkey> <bytes> this.subkey = BTreeUtil.hexStringToByteArrays(splited[1].substring(2)); this.dataLength = Integer.parseInt(splited[2]); this.eflag = null; } else if (splited.length == 4) { // ELEMENT <bkey> <eflag> <bytes> this.subkey = BTreeUtil.hexStringToByteArrays(splited[1].substring(2)); this.eflag = BTreeUtil.hexStringToByteArrays(splited[2].substring(2)); this.dataLength = Integer.parseInt(splited[3]); } }
@Override public String toString() { return "SMGetElement {KEY:" + key + ", BKEY:" + ((bytebkey == null) ? bkey : BTreeUtil.toHex(bytebkey)) + ", VALUE:" + value + "}"; }
@Override public int compareTo(ByteArrayBKey o) { return BTreeUtil.compareByteArraysInLexOrder(bkey, o.getBytes()); }
public BTreeGet(byte[] from, byte[] to, int offset, int count, boolean delete, boolean dropIfEmpty, ElementFlagFilter elementFlagFilter) { this.headerCount = 2; this.range = BTreeUtil.toHex(from) + ".." + BTreeUtil.toHex(to); this.offset = offset; this.count = count; this.delete = delete; this.dropIfEmpty = dropIfEmpty; this.elementFlagFilter = elementFlagFilter; }
public int compareBkeyTo(SMGetElement<T> param) { assert param != null; /* compare bkey */ if (bytebkey == null) return new Long(bkey).compareTo(param.getBkey()); else return BTreeUtil.compareByteArraysInLexOrder(bytebkey, param.getByteBkey()); }
public BTreeDelete(byte[] bkey, boolean noreply, boolean dropIfEmpty, ElementMultiFlagsFilter elementMultiFlagsFilter) { this.range = BTreeUtil.toHex(bkey); this.noreply = noreply; this.dropIfEmpty = dropIfEmpty; this.elementFlagFilter = (ElementFlagFilter) elementMultiFlagsFilter; }
public void decodeItemHeader(String itemHeader) { String[] splited = itemHeader.split(" "); if (splited.length == 3) { // ELEMENT <bkey> <bytes> this.subkey = Long.parseLong(splited[1]); this.dataLength = Integer.parseInt(splited[2]); this.eflag = null; } else if (splited.length == 4) { // ELEMENT <bkey> <eflag> <bytes> this.subkey = Long.parseLong(splited[1]); this.eflag = BTreeUtil.hexStringToByteArrays(splited[2].substring(2)); this.dataLength = Integer.parseInt(splited[3]); } }
public BTreeSMGetWithByteTypeBkeyOld(List<String> keyList, byte[] from, byte[] to, ElementFlagFilter eFlagFilter, int offset, int count) { this.keyList = keyList; this.range = BTreeUtil.toHex(from) + ".." + BTreeUtil.toHex(to); this.eFlagFilter = eFlagFilter; this.offset = offset; this.count = count; this.reverse = BTreeUtil.compareByteArraysInLexOrder(from, to) > 0; }
public int compareBkeyTo(SMGetTrimKey param) { assert param != null; /* compare bkey */ if (bytebkey == null) return new Long(bkey).compareTo(param.getBkey()); else return BTreeUtil.compareByteArraysInLexOrder(bytebkey, param.getByteBkey()); }
/** * get bkey * * @return bkey by hex (e.g. 0x01) */ public String getBkeyByHex() { return BTreeUtil.toHex(bkey); }
public void decodeItemHeader(String itemHeader) { String[] splited = itemHeader.split(" "); /* with flag VALUE 1 SMGetTest31 0 0x01 0x45464C4147 6 VALUE1 MISSED_KEYS 0 END without flag VALUE 1 SMGetTest31 0 0x01 6 VALUE1 MISSED_KEYS 0 END */ this.key = splited[0]; this.flag = Integer.parseInt(splited[1]); this.subkey = BTreeUtil.hexStringToByteArrays(splited[2].substring(2)); if (splited[3].startsWith("0x")) { this.eflag = BTreeUtil.hexStringToByteArrays(splited[3].substring(2)); this.dataLength = Integer.parseInt(splited[4]); } else { this.eflag = null; this.dataLength = Integer.parseInt(splited[3]); } } }
protected BTreeGetBulkImpl(List<String> keyList, byte[] from, byte[] to, ElementFlagFilter eFlagFilter, int offset, int count) { this.keyList = keyList; this.range = BTreeUtil.toHex(from) + ".." + BTreeUtil.toHex(to); this.eFlagFilter = eFlagFilter; this.offset = offset; this.count = count; this.reverse = BTreeUtil.compareByteArraysInLexOrder(from, to) > 0; }
@Override public <T> CollectionFuture<Map<ByteArrayBKey, Element<T>>> asyncBopGet( String key, byte[] from, byte[] to, ElementFlagFilter eFlagFilter, int offset, int count, boolean withDelete, boolean dropIfEmpty, Transcoder<T> tc) { BTreeGet get = new BTreeGet(from, to, offset, count, withDelete, dropIfEmpty, eFlagFilter); boolean reverse = BTreeUtil.compareByteArraysInLexOrder(from, to) > 0; return asyncBopExtendedGet(key, get, reverse, tc); }
public BTreeDelete(byte[] from, byte[] to, int count, boolean noreply, boolean dropIfEmpty, ElementMultiFlagsFilter elementMultiFlagsFilter) { this.range = BTreeUtil.toHex(from) + ".." + BTreeUtil.toHex(to); this.count = count; this.noreply = noreply; this.dropIfEmpty = dropIfEmpty; this.elementFlagFilter = (ElementFlagFilter) elementMultiFlagsFilter; }
public void decodeItemHeader(String itemHeader) { String[] splited = itemHeader.split(" "); /* with flag VALUE 1 SMGetTest31 0 1 0x45464C4147 6 VALUE1 MISSED_KEYS 0 END without flag VALUE 1 SMGetTest31 0 1 6 VALUE1 MISSED_KEYS 0 END */ this.key = splited[0]; this.flag = Integer.parseInt(splited[1]); this.subkey = Long.parseLong(splited[2]); if (splited[3].startsWith("0x")) { this.eflag = BTreeUtil.hexStringToByteArrays(splited[3].substring(2)); this.dataLength = Integer.parseInt(splited[4]); } else { this.eflag = null; this.dataLength = Integer.parseInt(splited[3]); } } }
@Override public int compareTo(SMGetTrimKey param) { assert param != null; int comp; /* compare bkey */ if (bytebkey == null) comp = new Long(bkey).compareTo(param.getBkey()); else comp = BTreeUtil.compareByteArraysInLexOrder(bytebkey, param.getByteBkey()); /* if bkey is equal, then compare key */ if (comp == 0) comp = key.compareTo(param.getKey()); return comp; }
public void decodeItemHeader(String itemHeader) { String[] splited = itemHeader.split(" "); /* with flag VALUE 1 SMGetTest31 0 0x01 0x45464C4147 6 VALUE1 MISSED_KEYS 0 END without flag VALUE 1 SMGetTest31 0 0x01 6 VALUE1 MISSED_KEYS 0 END */ this.key = splited[0]; this.flag = Integer.parseInt(splited[1]); this.subkey = BTreeUtil.hexStringToByteArrays(splited[2].substring(2)); if (splited[3].startsWith("0x")) { this.eflag = BTreeUtil.hexStringToByteArrays(splited[3].substring(2)); this.dataLength = Integer.parseInt(splited[4]); } else { this.eflag = null; this.dataLength = Integer.parseInt(splited[3]); } } }
@Override public int compareTo(SMGetElement<T> param) { assert param != null; int comp; /* compare bkey */ if (bytebkey == null) comp = new Long(bkey).compareTo(param.getBkey()); else comp = BTreeUtil.compareByteArraysInLexOrder(bytebkey, param.getByteBkey()); /* if bkey is equal, then compare key */ if (comp == 0) comp = key.compareTo(param.getKey()); return comp; }