case '\\': if (hadSlash) { text.append(textBytes, i, 1); hadSlash = false; if (hadSlash) { byte[] newLine = newLineUnescapeBytes; text.append(newLine, 0, newLine.length); text.append(textBytes, i, 1); if (hadSlash) { byte[] carriageReturn = carriageReturnUnescapeBytes; text.append(carriageReturn, 0, carriageReturn.length); text.append(textBytes, i, 1); if (hadSlash) { byte[] tab = tabUnescapeBytes; text.append(tab, 0, tab.length); text.append(textBytes, i, 1); text.append(textBytes, i-1, 1); hadSlash = false; text.append(ctrlA, 0, ctrlA.length); break;
case '\\': if (hadSlash) { text.append(textBytes, i, 1); hadSlash = false; if (hadSlash) { byte[] newLine = newLineUnescapeBytes; text.append(newLine, 0, newLine.length); text.append(textBytes, i, 1); if (hadSlash) { byte[] carriageReturn = carriageReturnUnescapeBytes; text.append(carriageReturn, 0, carriageReturn.length); text.append(textBytes, i, 1); if (hadSlash) { byte[] tab = tabUnescapeBytes; text.append(tab, 0, tab.length); text.append(textBytes, i, 1); text.append(textBytes, i-1, 1); hadSlash = false; text.append(ctrlA, 0, ctrlA.length); break;
escape.append(escaped, start, len);
escape.append(escaped, start, len);
if (bufferLength <= 0) { if (ambiguousByteCount > 0) { str.append(recordDelimiterBytes, 0, ambiguousByteCount); bytesConsumed += ambiguousByteCount; if (appendLength >= 0 && ambiguousByteCount > 0) { str.append(recordDelimiterBytes, 0, ambiguousByteCount); ambiguousByteCount = 0; str.append(buffer, startPosn, appendLength); txtLength += appendLength;
str.append(buffer, startPosn, appendLength); txtLength += appendLength;
private static Text nextRow(Text row) { Text next = new Text(row); next.append(byte0, 0, byte0.length); return next; }
public static Text getRow(Table.ID tableId, Text endRow) { Text entry = new Text(tableId.getUtf8()); if (endRow == null) { // append delimiter for default tablet entry.append(new byte[] {'<'}, 0, 1); } else { // append delimiter for regular tablets entry.append(new byte[] {';'}, 0, 1); entry.append(endRow.getBytes(), 0, endRow.getLength()); } return entry; }
static Text decode(String s) { Text t = new Text(); byte[] sb = s.getBytes(UTF_8); // very inefficient code for (int i = 0; i < sb.length; i++) { if (sb[i] != '%') { t.append(new byte[] {sb[i]}, 0, 1); } else { byte hex[] = {sb[++i], sb[++i]}; String hs = new String(hex, UTF_8); int b = Integer.parseInt(hs, 16); t.append(new byte[] {(byte) b}, 0, 1); } } return t; } }
public Text nextUrlText() { Text result = new Text("http://"); int ulen = nextUrlLength(); byte[] url = new byte[ulen + 7]; for (int i=0; i<ulen; i++) { url[i] = (byte) (randUrl.nextInt(26) + 'a'); } result.append(url, 0, ulen); return result; }
public TabletLocatorImpl(Table.ID tableId, TabletLocator parent, TabletLocationObtainer tlo, TabletServerLockChecker tslc) { this.tableId = tableId; this.parent = parent; this.locationObtainer = tlo; this.lockChecker = tslc; this.lastTabletRow = new Text(tableId.getUtf8()); lastTabletRow.append(new byte[] {'<'}, 0, 1); }
private static Text rowAfterPrevRow(KeyExtent nke) { Text row = new Text(nke.getPrevEndRow()); row.append(new byte[] {0}, 0, 1); return row; }
protected static Text getStartRowForExtent(KeyExtent extent) { Text start = extent.getPrevEndRow(); if (start != null) { start = new Text(start); // ACCUMULO-3967 We want the first possible key in this tablet, not the following row from the // previous tablet start.append(byte0, 0, 1); } return start; }
private static Text rowAfterPrevRow(KeyExtent nke) { Text row = new Text(nke.getPrevEndRow()); row.append(new byte[] {0}, 0, 1); return row; }
private static Text findInitialEnd(Scanner scanner) { Text end = new Text(new byte[] {(byte) 0xff, (byte) 0xff, (byte) 0xff, (byte) 0xff}); scanner.setRange(new Range(end, null)); while (scanner.iterator().hasNext()) { Text t = new Text(); t.append(end.getBytes(), 0, end.getLength()); t.append(end.getBytes(), 0, end.getLength()); end = t; scanner.setRange(new Range(end, null)); } return end; }
protected Key buildDocKey() { if (log.isTraceEnabled()) log.trace("building doc key for {} {}", currentPartition, currentDocID); int zeroIndex = currentDocID.find("\0"); if (zeroIndex < 0) throw new IllegalArgumentException("bad current docID"); Text colf = new Text(docColf); colf.append(nullByte, 0, 1); colf.append(currentDocID.getBytes(), 0, zeroIndex); docColfSet = Collections.singleton(new ArrayByteSequence(colf.getBytes(), 0, colf.getLength())); if (log.isTraceEnabled()) log.trace("{} {}", zeroIndex, currentDocID.getLength()); Text colq = new Text(); colq.set(currentDocID.getBytes(), zeroIndex + 1, currentDocID.getLength() - zeroIndex - 1); Key k = new Key(currentPartition, colf, colq); if (log.isTraceEnabled()) log.trace("built doc key for seek: {}", k); return k; }
row.append(new byte[] {0}, 0, 1);
if (row != null && (endRow == null || row.compareTo(endRow) < 0)) { row = new Text(row); row.append(byte0, 0, byte0.length); } else break;