/** * A convenience method for setting the range of timestamps accepted by the timestamp filter. * * @param is * the iterator setting object to configure * @param start * the start timestamp (yyyyMMddHHmmssz) * @param startInclusive * boolean indicating whether the start is inclusive * @param end * the end timestamp (yyyyMMddHHmmssz) * @param endInclusive * boolean indicating whether the end is inclusive */ public static void setRange(IteratorSetting is, String start, boolean startInclusive, String end, boolean endInclusive) { setStart(is, start, startInclusive); setEnd(is, end, endInclusive); }
/** * A convenience method for setting the range of timestamps accepted by the timestamp filter. * * @param is * the iterator setting object to configure * @param start * the start timestamp * @param startInclusive * boolean indicating whether the start is inclusive * @param end * the end timestamp * @param endInclusive * boolean indicating whether the end is inclusive */ public static void setRange(IteratorSetting is, long start, boolean startInclusive, long end, boolean endInclusive) { setStart(is, start, startInclusive); setEnd(is, end, endInclusive); }
/** * A convenience method for setting the end timestamp accepted by the timestamp filter. * * @param is * the iterator setting object to configure * @param end * the end timestamp (yyyyMMddHHmmssz) * @param endInclusive * boolean indicating whether the end is inclusive */ public static void setEnd(IteratorSetting is, String end, boolean endInclusive) { SimpleDateFormat dateParser = initDateParser(); try { long endTS = dateParser.parse(end).getTime(); setEnd(is, endTS, endInclusive); } catch (ParseException e) { throw new IllegalArgumentException("couldn't parse " + end); } }
/** * A convenience method for setting the range of timestamps accepted by the timestamp filter. * * @param is * the iterator setting object to configure * @param start * the start timestamp (yyyyMMddHHmmssz) * @param startInclusive * boolean indicating whether the start is inclusive * @param end * the end timestamp (yyyyMMddHHmmssz) * @param endInclusive * boolean indicating whether the end is inclusive */ public static void setRange(IteratorSetting is, String start, boolean startInclusive, String end, boolean endInclusive) { setStart(is, start, startInclusive); setEnd(is, end, endInclusive); }
/** * A convenience method for setting the end timestamp accepted by the timestamp filter. * * @param is * the iterator setting object to configure * @param end * the end timestamp (yyyyMMddHHmmssz) * @param endInclusive * boolean indicating whether the end is inclusive */ public static void setEnd(IteratorSetting is, String end, boolean endInclusive) { SimpleDateFormat dateParser = initDateParser(); try { long endTS = dateParser.parse(end).getTime(); setEnd(is, endTS, endInclusive); } catch (ParseException e) { throw new IllegalArgumentException("couldn't parse " + end); } }
/** * A convenience method for setting the range of timestamps accepted by the timestamp filter. * * @param is * the iterator setting object to configure * @param start * the start timestamp * @param startInclusive * boolean indicating whether the start is inclusive * @param end * the end timestamp * @param endInclusive * boolean indicating whether the end is inclusive */ public static void setRange(IteratorSetting is, long start, boolean startInclusive, long end, boolean endInclusive) { setStart(is, start, startInclusive); setEnd(is, end, endInclusive); }
/** * Creates an {@link IteratorSetting} with a time stamp filter that starts with the specified data. * @param time the start time of the filter. * @return the {@link IteratorSetting}. */ private static IteratorSetting getStartTimeSetting(final Date time) { final IteratorSetting setting = new IteratorSetting(1, "startTimeIterator", TimestampFilter.class); TimestampFilter.setStart(setting, time.getTime(), true); TimestampFilter.setEnd(setting, Long.MAX_VALUE, true); return setting; }
/** * Creates an {@link IteratorSetting} with a time stamp filter that starts with the specified data. * @param time the start time of the filter. * @return the {@link IteratorSetting}. */ private static IteratorSetting getStartTimeSetting(final Date time) { final IteratorSetting setting = new IteratorSetting(1, "startTimeIterator", TimestampFilter.class); TimestampFilter.setStart(setting, time.getTime(), true); TimestampFilter.setEnd(setting, Long.MAX_VALUE, true); return setting; }
/** * Creates an {@link IteratorSetting} with a time stamp filter that starts with the specified data. * @param time the start time of the filter. * @return the {@link IteratorSetting}. */ public static IteratorSetting getStartTimeSetting(final long time) { final IteratorSetting setting = new IteratorSetting(1, "startTimeIterator", TimestampFilter.class); TimestampFilter.setStart(setting, time, true); TimestampFilter.setEnd(setting, Long.MAX_VALUE, true); return setting; }
private ScannerBase getScanner() throws IOException { if (closed) { throw new IOException("stream already closed"); } if (scanner != null) { return scanner; } ArrayList<Range> ranges = Lists.newArrayList(RangeUtils.createRangeFromString(dataRowKey)); timerStartTime = System.currentTimeMillis(); try { scanner = graph.createBatchScanner(graph.getDataTableName(), ranges, new org.apache.accumulo.core.security.Authorizations()); } catch (TableNotFoundException ex) { throw new VertexiumException("Could not create scanner", ex); } IteratorSetting iteratorSetting = new IteratorSetting( 80, TimestampFilter.class.getSimpleName(), TimestampFilter.class ); TimestampFilter.setStart(iteratorSetting, timestamp, true); TimestampFilter.setEnd(iteratorSetting, timestamp, true); scanner.addScanIterator(iteratorSetting); graph.getGraphLogger().logStartIterator(graph.getDataTableName(), scanner); trace = Trace.start("streamingPropertyValueTableData"); trace.data("dataRowKeyCount", Integer.toString(1)); return scanner; }
private ScannerBase getScanner() throws IOException { if (closed) { throw new IOException("stream already closed"); } if (scanner != null) { return scanner; } ArrayList<Range> ranges = Lists.newArrayList(RangeUtils.createRangeFromString(dataRowKey)); timerStartTime = System.currentTimeMillis(); try { scanner = graph.createBatchScanner(graph.getDataTableName(), ranges, new org.apache.accumulo.core.security.Authorizations()); } catch (TableNotFoundException ex) { throw new VertexiumException("Could not create scanner", ex); } IteratorSetting iteratorSetting = new IteratorSetting( 80, TimestampFilter.class.getSimpleName(), TimestampFilter.class ); TimestampFilter.setStart(iteratorSetting, timestamp, true); TimestampFilter.setEnd(iteratorSetting, timestamp, true); scanner.addScanIterator(iteratorSetting); graph.getGraphLogger().logStartIterator(graph.getDataTableName(), scanner); trace = Trace.start("streamingPropertyValueTableData"); trace.data("dataRowKeyCount", Integer.toString(1)); return scanner; }
if (currentTime != null) { TimestampFilter.setStart(setting, currentTime - ttl, true); TimestampFilter.setEnd(setting, currentTime, true);
); TimestampFilter.setStart(iteratorSetting, timestamp, true); TimestampFilter.setEnd(iteratorSetting, timestamp, true); scanner.addScanIterator(iteratorSetting);
); TimestampFilter.setStart(iteratorSetting, timestamp, true); TimestampFilter.setEnd(iteratorSetting, timestamp, true); scanner.addScanIterator(iteratorSetting);
if (currentTime != null) { TimestampFilter.setStart(setting, currentTime - ttl, true); TimestampFilter.setEnd(setting, currentTime, true);
TimestampFilter.setEnd(iteratorSetting, endTime, true);
TimestampFilter.setEnd(iteratorSetting, endTime, true);
private Scanner createScanner(Query<K,T> query) throws TableNotFoundException { // TODO make isolated scanner optional? Scanner scanner = new IsolatedScanner(conn.createScanner(mapping.tableName, Authorizations.EMPTY)); setFetchColumns(scanner, query.getFields()); scanner.setRange(createRange(query)); if (query.getStartTime() != -1 || query.getEndTime() != -1) { IteratorSetting is = new IteratorSetting(30, TimestampFilter.class); if (query.getStartTime() != -1) TimestampFilter.setStart(is, query.getStartTime(), true); if (query.getEndTime() != -1) TimestampFilter.setEnd(is, query.getEndTime(), true); scanner.addScanIterator(is); } return scanner; }