/** * Returns a Span that covers all columns beginning with a row and {@link Column} prefix. The * {@link Column} passed to this method can be constructed without a qualifier or visibility to * create a prefix Span at the family or qualifier level. String parameters will be encoded as * UTF-8 */ public static Span prefix(CharSequence row, Column colPrefix) { Objects.requireNonNull(row); Objects.requireNonNull(colPrefix); return prefix(Bytes.of(row), colPrefix); }
public Iterator<ExportEntry> getExportIterator(Bytes continueRow) { Span span; if (continueRow != null) { Span tmpSpan = Span.prefix(bucketRow); Span nextSpan = new Span(new RowColumn(continueRow, EXPORT_COL), true, tmpSpan.getEnd(), tmpSpan.isEndInclusive()); span = nextSpan; } else { span = Span.prefix(bucketRow); } CellScanner scanner = ttx.scanner().over(span).fetch(EXPORT_COL).build(); return new ExportIterator(scanner); }
/** * Creates a Span that covers an exact row and {@link Column}. The {@link Column} passed to this * method can be constructed without a qualifier or visibility to create a Span at the family or * qualifier level. String parameters will be encoded as UTF-8 */ public static Span exact(CharSequence row, Column col) { Objects.requireNonNull(row); Objects.requireNonNull(col); return exact(Bytes.of(row), col); }
/** * Updates the Span to create a new {@link BatchInformation} object to be fed to the * {@link BatchObserver}. This message is called in the event that the BatchBindingSetUpdater * reaches the batch size before processing all entries relevant to its Span. * @param newStart - new start to the Span * @param oldSpan - old Span to be updated with newStart * @return - updated Span used with an updated BatchInformation object to complete the batch task */ public static Span getNewSpan(RowColumn newStart, Span oldSpan) { return new Span(newStart, oldSpan.isStartInclusive(), oldSpan.getEnd(), oldSpan.isEndInclusive()); }
/** * Returns a Span that covers all rows beginning with a prefix. */ public static Span prefix(Bytes rowPrefix) { Objects.requireNonNull(rowPrefix); Bytes fp = followingPrefix(rowPrefix); return new Span(rowPrefix, true, fp == null ? Bytes.EMPTY : fp, false); }
/** * Converts a Fluo Span to Accumulo Range * * @param span Span * @return Range */ public static Range toRange(Span span) { return new Range(toKey(span.getStart()), span.isStartInclusive(), toKey(span.getEnd()), span.isEndInclusive()); }
public static Span getSpan(ScanOpts options) { Span span = new Span(); if ((options.getExactRow() != null) && ((options.getStartRow() != null) || (options.getEndRow() != null) || (options.getRowPrefix() != null))) { throw new IllegalArgumentException( "You cannot specify an exact row with a start/end row or row prefix!"); } if ((options.getRowPrefix() != null) && ((options.getStartRow() != null) || (options.getEndRow() != null) || (options.getExactRow() != null))) { throw new IllegalArgumentException( "You cannot specify an prefix row with a start/end row or exact row!"); } // configure span of scanner if (options.getExactRow() != null) { span = Span.exact(options.getExactRow()); } else if (options.getRowPrefix() != null) { span = Span.prefix(options.getRowPrefix()); } else { if ((options.getStartRow() != null) && (options.getEndRow() != null)) { span = new Span(options.getStartRow(), true, options.getEndRow(), true); } else if (options.getStartRow() != null) { span = new Span(Bytes.of(options.getStartRow()), true, Bytes.EMPTY, true); } else if (options.getEndRow() != null) { span = new Span(Bytes.EMPTY, true, Bytes.of(options.getEndRow()), true); } } return span; }
/** * Returns a Span that covers all columns beginning with a row and {@link Column} prefix. The * {@link Column} passed to this method can be constructed without a qualifier or visibility to * create a prefix Span at the family or qualifier level. */ public static Span prefix(Bytes row, Column colPrefix) { Objects.requireNonNull(row); Objects.requireNonNull(colPrefix); Bytes cf = colPrefix.getFamily(); Bytes cq = colPrefix.getQualifier(); Bytes cv = colPrefix.getVisibility(); if (colPrefix.isVisibilitySet()) { Bytes fp = followingPrefix(cv); RowColumn end = (fp == null ? new RowColumn(row, new Column(cf, cq)).following() : new RowColumn(row, new Column(cf, cq, fp))); return new Span(new RowColumn(row, colPrefix), true, end, false); } else if (colPrefix.isQualifierSet()) { Bytes fp = followingPrefix(cq); RowColumn end = (fp == null ? new RowColumn(row, new Column(cf)).following() : new RowColumn(row, new Column(cf, fp))); return new Span(new RowColumn(row, colPrefix), true, end, false); } else if (colPrefix.isFamilySet()) { Bytes fp = followingPrefix(cf); RowColumn end = (fp == null ? new RowColumn(row).following() : new RowColumn(row, new Column(fp))); return new Span(new RowColumn(row, colPrefix), true, end, false); } else { return prefix(row); } }
/** * Build Span */ public Span build() { return new Span(builder); } }
int numRead = 0; RowColumn origEnd = snapIterConfig.getSpan().getEnd(); boolean isEndInclusive = snapIterConfig.getSpan().isEndInclusive(); RowColumn end = SpanUtil.toRowColumn(locks.get(locks.size() - 1).getKey()).following(); resetScanner(new Span(start, true, end, false)); resetScanner(new Span(start, true, origEnd, isEndInclusive));
Bytes row = span.getStart().getRow();
/** * Converts a Fluo Span to Accumulo Range * * @param span Span * @return Range */ public static Range toRange(Span span) { return new Range(toKey(span.getStart()), span.isStartInclusive(), toKey(span.getEnd()), span.isEndInclusive()); }
public static Span getSpan(ScanOpts options) { Span span = new Span(); if ((options.getExactRow() != null) && ((options.getStartRow() != null) || (options.getEndRow() != null) || (options.getRowPrefix() != null))) { throw new IllegalArgumentException( "You cannot specify an exact row with a start/end row or row prefix!"); } if ((options.getRowPrefix() != null) && ((options.getStartRow() != null) || (options.getEndRow() != null) || (options.getExactRow() != null))) { throw new IllegalArgumentException( "You cannot specify an prefix row with a start/end row or exact row!"); } // configure span of scanner if (options.getExactRow() != null) { span = Span.exact(options.getExactRow()); } else if (options.getRowPrefix() != null) { span = Span.prefix(options.getRowPrefix()); } else { if ((options.getStartRow() != null) && (options.getEndRow() != null)) { span = new Span(options.getStartRow(), true, options.getEndRow(), true); } else if (options.getStartRow() != null) { span = new Span(Bytes.of(options.getStartRow()), true, Bytes.EMPTY, true); } else if (options.getEndRow() != null) { span = new Span(Bytes.EMPTY, true, Bytes.of(options.getEndRow()), true); } } return span; }
/** * Returns a Span that covers all columns beginning with a row and {@link Column} prefix. The * {@link Column} passed to this method can be constructed without a qualifier or visibility to * create a prefix Span at the family or qualifier level. */ public static Span prefix(Bytes row, Column colPrefix) { Objects.requireNonNull(row); Objects.requireNonNull(colPrefix); Bytes cf = colPrefix.getFamily(); Bytes cq = colPrefix.getQualifier(); Bytes cv = colPrefix.getVisibility(); if (colPrefix.isVisibilitySet()) { Bytes fp = followingPrefix(cv); RowColumn end = (fp == null ? new RowColumn(row, new Column(cf, cq)).following() : new RowColumn(row, new Column(cf, cq, fp))); return new Span(new RowColumn(row, colPrefix), true, end, false); } else if (colPrefix.isQualifierSet()) { Bytes fp = followingPrefix(cq); RowColumn end = (fp == null ? new RowColumn(row, new Column(cf)).following() : new RowColumn(row, new Column(cf, fp))); return new Span(new RowColumn(row, colPrefix), true, end, false); } else if (colPrefix.isFamilySet()) { Bytes fp = followingPrefix(cf); RowColumn end = (fp == null ? new RowColumn(row).following() : new RowColumn(row, new Column(fp))); return new Span(new RowColumn(row, colPrefix), true, end, false); } else { return prefix(row); } }
/** * Updates the Span to create a new {@link BatchInformation} object to be fed to the * {@link BatchObserver}. This message is called in the event that the BatchBindingSetUpdater * reaches the batch size before processing all entries relevant to its Span. * @param newStart - new start to the Span * @param oldSpan - old Span to be updated with newStart * @return - updated Span used with an updated BatchInformation object to complete the batch task */ public static Span getNewSpan(RowColumn newStart, Span oldSpan) { return new Span(newStart, oldSpan.isStartInclusive(), oldSpan.getEnd(), oldSpan.isEndInclusive()); }
/** * Build Span */ public Span build() { return new Span(builder); } }
int numRead = 0; RowColumn origEnd = snapIterConfig.getSpan().getEnd(); boolean isEndInclusive = snapIterConfig.getSpan().isEndInclusive(); RowColumn end = SpanUtil.toRowColumn(locks.get(locks.size() - 1).getKey()).following(); resetScanner(new Span(start, true, end, false)); resetScanner(new Span(start, true, origEnd, isEndInclusive));
/** * Returns a Span that covers all rows beginning with a prefix. */ public static Span prefix(Bytes rowPrefix) { Objects.requireNonNull(rowPrefix); Bytes fp = followingPrefix(rowPrefix); return new Span(rowPrefix, true, fp == null ? Bytes.EMPTY : fp, false); }
Bytes row = span.getStart().getRow();
/** * Returns a Span that covers all rows beginning with a prefix String parameters will be encoded * as UTF-8 */ public static Span prefix(CharSequence rowPrefix) { Objects.requireNonNull(rowPrefix); return prefix(Bytes.of(rowPrefix)); }