public IdentifiedDataSerializable createNew(Integer arg) { return new AddIndexOperation(); } };
@Override public void run() throws Exception { Indexes indexes = mapContainer.getIndexes(getPartitionId()); Index index = indexes.addOrGetIndex(attributeName, ordered); final long now = getNow(); final Iterator<Record> iterator = recordStore.iterator(now, false); SerializationService serializationService = getNodeEngine().getSerializationService(); while (iterator.hasNext()) { final Record record = iterator.next(); Data key = record.getKey(); Object value = Records.getValueOrCachedValue(record, serializationService); QueryableEntry queryEntry = mapContainer.newQueryEntry(key, value); index.saveEntryIndex(queryEntry, null, Index.OperationSource.USER); } }
@Override public void run() throws Exception { int partitionId = getPartitionId(); Indexes indexes = mapContainer.getIndexes(partitionId); InternalIndex index = indexes.addOrGetIndex(attributeName, ordered); if (index.hasPartitionIndexed(partitionId)) { return; } final long now = getNow(); final Iterator<Record> iterator = recordStore.iterator(now, false); SerializationService serializationService = getNodeEngine().getSerializationService(); while (iterator.hasNext()) { final Record record = iterator.next(); Data key = record.getKey(); Object value = Records.getValueOrCachedValue(record, serializationService); QueryableEntry queryEntry = mapContainer.newQueryEntry(key, value); index.putEntry(queryEntry, null, Index.OperationSource.USER); } index.markPartitionAsIndexed(partitionId); }
@Override public Operation createOperation() { return new AddIndexOperation(name, attributeName, ordered); }
@Override public Operation createOperation() { return new AddIndexOperation(name, attributeName, ordered); }
public IdentifiedDataSerializable createNew(Integer arg) { return new AddIndexOperation(); } };
@Override public void addIndex(String attribute, boolean ordered) { validateIndexAttribute(attribute); try { AddIndexOperation addIndexOperation = new AddIndexOperation(name, attribute, ordered); operationService.invokeOnAllPartitions(SERVICE_NAME, new BinaryOperationFactory(addIndexOperation, getNodeEngine())); } catch (Throwable t) { throw rethrow(t); } }
@Override public void addIndex(String attribute, boolean ordered) { validateIndexAttribute(attribute); try { AddIndexOperation addIndexOperation = new AddIndexOperation(name, attribute, ordered); operationService.invokeOnAllPartitions(SERVICE_NAME, new BinaryOperationFactory(addIndexOperation, getNodeEngine())); } catch (Throwable t) { throw rethrow(t); } }