@Override public Set<QueryableEntry> filter(QueryContext queryContext) { Index index = getIndex(queryContext); if (index != null) { return index.getRecords(values); } else { return null; } }
public void addMapIndex(MapContainer mapContainer) { final IndexService indexService = mapContainer.getIndexService(); if (indexService.hasIndex()) { MapIndexInfo mapIndexInfo = new MapIndexInfo(mapContainer.getName()); for (Index index : indexService.getIndexes()) { mapIndexInfo.addIndexInfo(index.getAttributeName(), index.isOrdered()); } indexInfoList.add(mapIndexInfo); } }
@Override public void run() throws Exception { Indexes indexes = mapContainer.getIndexes(); 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); } }
private void useConverter(TypeConverter converter) { when(mockIndex.getConverter()).thenReturn(converter); }