@SuppressWarnings({ "unchecked", "rawtypes" }) public final Map<InternalDistributedMember, ReplyException> getExceptions() { if (this.exceptions != null) { synchronized (this) { return new THashMap((Map)this.exceptions); } } return null; }
@SuppressWarnings({ "unchecked", "rawtypes" }) public final Map<InternalDistributedMember, ReplyException> getExceptions() { if (this.exceptions != null) { synchronized (this) { return new THashMap((Map)this.exceptions); } } return null; }
protected ReferencedKeyCheckerMessage( final ReferencedKeyCheckerMessage other) { super(other); this.container = other.container; this.schemaName = other.schemaName; this.tableName = other.tableName; this.keyColumnDVDs = other.keyColumnDVDs; this.keyColumnLocations = other.keyColumnLocations; this.connectionId = other.connectionId; this.refContainers = other.refContainers; this.hostedBuckets = new THashMap(); this.forUpdate = other.forUpdate; this.refImpactedCols = other.refImpactedCols; this.refColsUpdtdBits = other.refColsUpdtdBits; this.refCol2DVDPosMapping = other.refCol2DVDPosMapping; this.refColUpdtd2DependentCols = other.refColUpdtd2DependentCols; this.refCol2IndexMap = other.refCol2IndexMap; }
protected ReferencedKeyCheckerMessage( final ReferencedKeyCheckerMessage other) { super(other); this.container = other.container; this.schemaName = other.schemaName; this.tableName = other.tableName; this.keyColumnDVDs = other.keyColumnDVDs; this.keyColumnLocations = other.keyColumnLocations; this.connectionId = other.connectionId; this.refContainers = other.refContainers; this.hostedBuckets = new THashMap(); this.forUpdate = other.forUpdate; this.refImpactedCols = other.refImpactedCols; this.refColsUpdtdBits = other.refColsUpdtdBits; this.refCol2DVDPosMapping = other.refCol2DVDPosMapping; this.refColUpdtd2DependentCols = other.refColUpdtd2DependentCols; this.refCol2IndexMap = other.refCol2IndexMap; }
protected ReferencedKeyCheckerMessage( final ReferencedKeyCheckerMessage other) { super(other); this.container = other.container; this.schemaName = other.schemaName; this.tableName = other.tableName; this.keyColumnDVDs = other.keyColumnDVDs; this.keyColumnLocations = other.keyColumnLocations; this.connectionId = other.connectionId; this.refContainers = other.refContainers; this.hostedBuckets = new THashMap(); this.forUpdate = other.forUpdate; this.refImpactedCols = other.refImpactedCols; this.refColsUpdtdBits = other.refColsUpdtdBits; this.refCol2DVDPosMapping = other.refCol2DVDPosMapping; this.refColUpdtd2DependentCols = other.refColUpdtd2DependentCols; this.refCol2IndexMap = other.refCol2IndexMap; }
public PRQueryResultCollector() { this.resultQueue = new LinkedBlockingQueue();; this.usedIndexInfoMap = new THashMap(); //{indexName, IndexInfo} Map }
public void ours() { Map ours = new THashMap(dataset.size()); for (Iterator i = dataset.iterator();i.hasNext();) { Object o = i.next(); ours.put(o,o); } }
public Object create() { THashMap map = new THashMap(); for (int i = 0; i < 1000; i++) { Integer x = Integer.valueOf(i); map.put(x,x); } return map; } }
@Override public Object create(Object key, Object params) { CacheProfile cp = (CacheProfile)params; if (cp.regionInitialized) { if (this.eventsToBePublished == null) { return null; } else { // put an empty placeHolder expecting some events for the member final ArrayList<Object> data = new ArrayList<Object>(2); data.add(new THashMap(4)); return data; } } else { this.hasUninitialized = true; final ArrayList<Object> data = new ArrayList<Object>(2); if (this.eventsToBePublished != null) { // put an empty placeHolder expecting some events for the member data.add(new THashMap(4)); } return data; } } };
public static ClientConnection create(String host, int port, Properties p) throws SQLException { final THashMap connProps = new THashMap(); @SuppressWarnings("unchecked") Map<String, String> props = connProps; String userName = null; String password = null; for (String propName : p.stringPropertyNames()) { if (Attribute.USERNAME_ATTR.equals(propName) || Attribute.USERNAME_ALT_ATTR.equals(propName)) { userName = p.getProperty(propName); } else if (Attribute.PASSWORD_ATTR.equals(propName)) { password = p.getProperty(propName); } else { connProps.put(propName, p.getProperty(propName)); } } if (connProps.size() == 0) { props = null; } return new ClientConnection(host, port, userName, password, props); }
public OrderByComparator(ObjectType objType) { this.objType = objType; if(objType.isStructType()) { orderByMap = new THashMap(new StructBag.ObjectArrayTHashingStrategy()); }else { this.orderByMap = new HashMap(); } }
@Override protected final synchronized void processException( final DistributionMessage msg, final ReplyException ex) { if (this.exceptions == null) { this.exceptions = new THashMap(); } this.exceptions.put(msg.getSender(), ex); super.processException(msg, ex); }
@Override protected final synchronized void processException( final DistributionMessage msg, final ReplyException ex) { if (this.exceptions == null) { this.exceptions = new THashMap(); } this.exceptions.put(msg.getSender(), ex); super.processException(msg, ex); }
public void testHashCodeEquals() throws Exception{ PdxInstanceFactory pf = PdxInstanceFactoryImpl.newCreator("Portfolio", false); pf.writeString("secId", "abc"); PdxInstanceImpl pi = (PdxInstanceImpl) pf.create(); PdxString pdx1 = (PdxString) pi.getRawField("secId"); Map<PdxString,String> map = new HashMap<PdxString,String>(); map.put(pdx1,"abc"); PdxString pdx2 = new PdxString("abc"); assertEquals(map.get(pdx2),"abc"); map = new THashMap(); map.put(pdx1,"abc"); assertEquals(map.get(pdx2),"abc"); }
@SuppressWarnings("unchecked") public Map<InternalDistributedMember, PersistentMemberID> adviseInitializedPersistentMembers() { initializationGate(); THashMap result = new THashMap(); Profile[] snapshot = this.profiles; for (Profile profile : snapshot) { CacheProfile cp = (CacheProfile)profile; if (cp.persistentID != null && cp.persistenceInitialized) { result.put(cp.getDistributedMember(), cp.persistentID); } } return result; }
/** * @param opCode * one of OTHER_OP, BEFORE_UPDATE_OP, AFTER_UPDATE_OP. */ void removeMapping(RegionEntry entry, int opCode) throws IMQException { if (opCode == BEFORE_UPDATE_OP) { // Either take key from reverse map OR evaluate it using IMQEvaluator. if (!IndexManager.isObjectModificationInplace()) { // It will always contain 1 element only, for this thread. if (entryToOldKeysMap == null) { entryToOldKeysMap = new ThreadLocal<THashMap>(); } entryToOldKeysMap.set(new THashMap(1)); this.evaluator.evaluate(entry, false); } } else { // Need to reset the thread-local map as many puts and destroys might // happen in same thread. if (entryToOldKeysMap != null) { entryToOldKeysMap.remove(); } this.evaluator.evaluate(entry, false); this.internalIndexStats.incNumUpdates(); } }
/** * Returns the list of all persistent members. * For most cases, adviseInitializedPersistentMembers is more appropriate. These * method includes members that are still in the process of GII. */ @SuppressWarnings("unchecked") public Map<InternalDistributedMember, PersistentMemberID> advisePersistentMembers() { initializationGate(); THashMap result = new THashMap(); Profile[] snapshot = this.profiles; for (Profile profile : snapshot) { CacheProfile cp = (CacheProfile)profile; if (cp.persistentID != null) { result.put(cp.getDistributedMember(), cp.persistentID); } } return result; }
/** * {@inheritDoc} */ @Override public Map<Long, String> fetchActiveStatements(long connId, ByteBuffer token) throws SnappyException { // only allow admin user checkDBOwner(connId, token, "fetchActiveStatements"); @SuppressWarnings("unchecked") final Map<Long, String> activeStmts = new THashMap(this.statementMap.size()); this.statementMap.forEachValue(new TObjectProcedure() { @Override public boolean execute(Object h) { final StatementHolder stmtHolder = (StatementHolder)h; activeStmts.put(stmtHolder.getStatementId(), String.valueOf(stmtHolder.getSQL())); return true; } }); return activeStmts; }
public ReferencedKeyCheckerMessage(final ReferencedKeyResultCollector rc, final TXStateInterface tx, final LanguageConnectionContext lcc, final GemFireContainer container, final ArrayList<DataValueDescriptor[]> keyColumnValues, final ArrayList<RowLocation> keyColumnLocations, final GemFireContainer[] refContainers, boolean forUpdate, int [] refImpactedCols, FormatableBitSet refColsUpdtdBits, TIntObjectHashMap refColUpdtd2DependentCols, TIntIntHashMap refCol2IndexMap, int[] colToDVDPosMapping ) { super(rc, tx, getTimeStatsSettings(lcc)); this.container = container; this.schemaName = container.getSchemaName(); if (this.schemaName == null) { this.schemaName = Misc.getDefaultSchemaName(lcc); } this.tableName = container.getTableName(); this.keyColumnDVDs = keyColumnValues; this.keyColumnLocations = keyColumnLocations; this.connectionId = lcc.getConnectionId(); this.refContainers = refContainers; this.hostedBuckets = new THashMap(); this.forUpdate = forUpdate; this.refImpactedCols = refImpactedCols; this.refColsUpdtdBits = refColsUpdtdBits; this.refCol2DVDPosMapping = colToDVDPosMapping; this.refColUpdtd2DependentCols = refColUpdtd2DependentCols; this.refCol2IndexMap = refCol2IndexMap; }
public static THashMap readTHashMap(DataInput in) throws IOException, ClassNotFoundException { InternalDataSerializer.checkIn(in); int size = InternalDataSerializer.readArrayLength(in); if (size == -1) { return null; } else { THashMap map = new THashMap(size); for (int i = 0; i < size; i++) { Object key = DataSerializer.readObject(in); Object value = DataSerializer.readObject(in); map.put(key, value); } if (DEBUG) { InternalDataSerializer.logger.info( LocalizedStrings.DEBUG, "Read THashMap with " + size + " elements: " + map); } return map; } } /**