/** * Pre-fetches the value associated with the key, if it is not already faulted into the VM. * * @param key * @return the current mapping, ObjectID if it is not faulted, Object if faulted, null if no mapping present. */ private Object prefetch(final Object key) { final Object obj = this.store.get(key); if (obj instanceof ObjectID) { // XXX::Note since we are reading outside the lock scope this might result in an ObjectNotFound Message sent from // the server, but we ignore it since it a result of pre-fetch request. ManagerUtil.preFetchObject((ObjectID) obj); } return obj; }
/** * Pre-fetches the value associated with the key, if it is not already faulted into the VM. * * @param key * @return the current mapping, ObjectID if it is not faulted, Object if faulted, null if no mapping present. */ private Object prefetch(final Object key) { final Object obj = this.store.get(key); if (obj instanceof ObjectID) { // XXX::Note since we are reading outside the lock scope this might result in an ObjectNotFound Message sent from // the server, but we ignore it since it a result of pre-fetch request. ManagerUtil.preFetchObject((ObjectID) obj); } return obj; }
/** * Pre-fetches the value associated with the key, if it is not already faulted into the VM. * * @param key * @return the current mapping, ObjectID if it is not faulted, Object if faulted, null if no mapping present. */ private Object prefetch(final Object key) { final Object obj = this.store.get(key); if (obj instanceof ObjectID) { // XXX::Note since we are reading outside the lock scope this might result in an ObjectNotFound Message sent from // the server, but we ignore it since it a result of pre-fetch request. ManagerUtil.preFetchObject((ObjectID) obj); } return obj; }
private void buildLocalStoreFromIds(Object[] ids, long lastModifiedTimeStamp) { LoggingUtil.info("Going to update " + ids.length + " objects to local index"); LoggingUtil.info("After l1CachedMapData size = " + l1CachedMapData.size() + " tsinfo size = " + tsInfo.getCreationtimeMap().size()); long startTime = System.currentTimeMillis(); for(int i = 0; i < ids.length; i++) { /** prefetching objects in a bunch, so as to get the better faulting from L2 **/ if(i%1000 == 0) { int countToFault = (ids.length - i) > 1000 ? 1000 : (ids.length - i); for(int k = 0; k < countToFault; k++) { ManagerUtil.preFetchObject( l1CachedMapData.get(ids[i+k]).valueObject); } } ObjectData<K> od = null; od = l1CachedMapData.get(ids[i]); Assert.assertNotNull(od); SerializationAdaptor<K,V> adaptor = new TCSearializationAdaptor<K,V>(lastModifiedTimeStamp); Object adaptedValue = ManagerUtil.lookupObject(od.valueObject); if(adaptedValue != null) { adaptor.setKey((K)ids[i]); adaptor.setAdaptedValue(adaptedValue); // deliberately ensuring that we do not deserialize the value object here // it will be deserialized by the datastore update threads. This ensures // even distribution of load across threads } ds.putNoWait(adaptor); } ds.waitUntilNoPendingUpdates(); LoggingUtil.info("SearchableMap.buildLocalStoreFromMap() Indexed " + ids.length + " with average " + (System.currentTimeMillis() - startTime)/1000); }