private void serializeViewStore(final DataOutput out) throws IOException { GraphViewStore viewStore = model.store.viewStore; serialize(out, viewStore.length); serialize(out, viewStore.views); serialize(out, viewStore.garbageQueue.toIntArray()); }
private void serializeViewStore(final DataOutput out) throws IOException { GraphViewStore viewStore = model.store.viewStore; serialize(out, viewStore.length); serialize(out, viewStore.views); serialize(out, viewStore.garbageQueue.toIntArray()); }
private void serializeIntervalIndexStore(final DataOutput out, final IntervalIndexStore intervalIndexStore) throws IOException { serialize(out, intervalIndexStore.elementType); serialize(out, intervalIndexStore.length); serialize(out, intervalIndexStore.getMap().size()); for (Map.Entry<Interval, Integer> entry : intervalIndexStore.getMap().entrySet()) { serialize(out, entry.getKey()); serialize(out, entry.getValue()); } serialize(out, intervalIndexStore.garbageQueue.toIntArray()); serialize(out, intervalIndexStore.countMap); }
private void serializeIntervalIndexStore(final DataOutput out, final IntervalIndexStore intervalIndexStore) throws IOException { serialize(out, intervalIndexStore.elementType); serialize(out, intervalIndexStore.length); serialize(out, intervalIndexStore.getMap().size()); for (Map.Entry<Interval, Integer> entry : intervalIndexStore.getMap().entrySet()) { serialize(out, entry.getKey()); serialize(out, entry.getValue()); } serialize(out, intervalIndexStore.garbageQueue.toIntArray()); serialize(out, intervalIndexStore.countMap); }
@SuppressWarnings("unchecked") public int nextInt() { if ( !hasNext() ) throw new NoSuchElementException(); ObjectList<Scan.VirtualDocumentFragment> vdf; try { vdf = (ObjectList<VirtualDocumentFragment>)cachedDocument.content( virtualField ); } catch ( IOException exc1 ) { throw new RuntimeException( exc1 ); } succ.clear(); resolver.context( cachedDocument ); ObjectIterator<VirtualDocumentFragment> it = vdf.iterator(); while ( it.hasNext() ) { int successor = resolver.resolve( it.next().documentSpecifier() ); if ( successor >= 0 ) succ.add( successor ); } cachedSuccessors = succ.toIntArray(); // Get ready for the next request try { cachedDocument.close(); cachedDocument = documentIterator.nextDocument(); } catch ( IOException e ) { throw new RuntimeException( e ); } return cachedDocumentNumber++; }
@SuppressWarnings("unchecked") public int nextInt() { if ( !hasNext() ) throw new NoSuchElementException(); ObjectList<Scan.VirtualDocumentFragment> vdf; try { vdf = (ObjectList<VirtualDocumentFragment>)cachedDocument.content( virtualField ); } catch ( IOException exc1 ) { throw new RuntimeException( exc1 ); } succ.clear(); resolver.context( cachedDocument ); ObjectIterator<VirtualDocumentFragment> it = vdf.iterator(); while ( it.hasNext() ) { int successor = resolver.resolve( it.next().documentSpecifier() ); if ( successor >= 0 ) succ.add( successor ); } cachedSuccessors = succ.toIntArray(); // Get ready for the next request try { cachedDocument.close(); cachedDocument = documentIterator.nextDocument(); } catch ( IOException e ) { throw new RuntimeException( e ); } return cachedDocumentNumber++; }
final int[] indexedField = indexedFields.toIntArray(); final String[] basenameField = new String[ indexedField.length ]; for( int i = 0; i < indexedField.length; i++ ) basenameField[ i ] = basename + "-" + factory.fieldName( indexedField[ i ] );
private void serializeTimestampIndexStore(final DataOutput out, final TimestampIndexStore timestampIndexStore) throws IOException { serialize(out, timestampIndexStore.elementType); serialize(out, timestampIndexStore.length); serialize(out, timestampIndexStore.getMap().keySet().toDoubleArray()); serialize(out, timestampIndexStore.getMap().values().toIntArray()); serialize(out, timestampIndexStore.garbageQueue.toIntArray()); serialize(out, timestampIndexStore.countMap); }
private void serializeTimestampIndexStore(final DataOutput out, final TimestampIndexStore timestampIndexStore) throws IOException { serialize(out, timestampIndexStore.elementType); serialize(out, timestampIndexStore.length); serialize(out, timestampIndexStore.getMap().keySet().toDoubleArray()); serialize(out, timestampIndexStore.getMap().values().toIntArray()); serialize(out, timestampIndexStore.garbageQueue.toIntArray()); serialize(out, timestampIndexStore.countMap); }
final int[] indexedField = indexedFields.toIntArray(); final String[] basenameField = new String[ indexedField.length ]; for( int i = 0; i < indexedField.length; i++ ) basenameField[ i ] = basename + "-" + factory.fieldName( indexedField[ i ] );
final int[] indexedField = indexedFields.toIntArray(); final String[] basenameField = new String[ indexedField.length ]; for( int i = 0; i < indexedField.length; i++ ) basenameField[ i ] = basename + "-" + factory.fieldName( indexedField[ i ] );
final int[] indexedField = indexedFields.toIntArray(); final String[] basenameField = new String[ indexedField.length ]; for( int i = 0; i < indexedField.length; i++ ) basenameField[ i ] = basename + "-" + factory.fieldName( indexedField[ i ] );
/** * Given a table, generate the Next K items in Sorted Order starting from a specified * rowSnapShot (topRow), together with counts. * @param data The input table on which we want to compute the NextK list. * @return A NextKList. */ public NextKList create(@Nullable ITable data) { IndexComparator comp = this.recordOrder.getIndexComparator(Converters.checkNull(data)); IntTopK topK = new IntTreeTopK(this.maxSize, comp); IRowIterator rowIt = data.getRowIterator(); int position = 0; Schema toBring = this.recordOrder.toSchema(); VirtualRowSnapshot vw = new VirtualRowSnapshot(data, toBring); for (int i = rowIt.getNextRow(); i >= 0; i = rowIt.getNextRow()) { vw.setRow(i); if ((this.topRow == null) || (this.topRow.compareTo(vw, this.recordOrder) <= 0)) topK.push(i); else position++; } Int2IntSortedMap topKList = topK.getTopK(); IRowOrder rowOrder = new ArrayRowOrder(topKList.keySet().toIntArray()); SmallTable topKRows = data.compress(this.recordOrder.toSchema(), rowOrder); IntList count = new IntArrayList(topKList.size()); count.addAll(topKList.values()); return new NextKList(topKRows, count, position, data.getNumOfRows()); }