public int size() { return THashMap.this.size(); }
public final void addElement(QueryTreeNode qt) { // GemStone changes BEGIN v.add(qt); if (this.visitedMap != null) { this.visitedMap.clear(); } /* (original code) v.addElement(qt); */ // GemStone changes END }
protected final void sendNewGIINodeMessages( final MemberToGIIRegions finishRecipients, final DM dm, final boolean forCommit) { THashMap members; if (finishRecipients.hasUninitialized && !(members = finishRecipients.members).isEmpty()) { members.forEachEntry(new TObjectObjectProcedure() { @SuppressWarnings("unchecked") @Override public boolean execute(Object m, Object l) { if (l != null) { TXNewGIINode.send(dm.getSystem(), dm, TXStateProxy.this, (InternalDistributedMember)m, (ArrayList<Object>)l, forCommit); } return true; } }); } }
if (v.supportsDeltaMerge()) { if (this.visitedMap == null) { this.visitedMap = new THashMap(); else if (this.visitedMap.size() > 0 && (delta = this.visitedMap.get(v.getClass())) != null) { return v.mergeDeltaState(delta, this); this.visitedMap.put(v.getClass(), v.getAndResetDeltaState()); this.visitedMap.put(v.getClass(), v.getAndResetDeltaState());
THashMap outProps = new THashMap(); outProps.put( propName.substring(DistributionConfig.GEMFIRE_PREFIX.length()), propValue); outProps.put( DistributionConfig.GFXD_USERDEFINED_PREFIX_NAME + propName.substring(DistributionConfig.USERDEFINED_PREFIX_NAME .length()), propValue); } else if ( propName.startsWith("gemfirexd.custom-")) { outProps.put( DistributionConfig.GFXD_USERDEFINED_PREFIX_NAME + propName.substring("gemfirexd.custom-".length()), propValue); outProps.put(propName, propValue); if (!outProps.contains(DistributionConfig.LOG_FILE_NAME)) { outProps.put(DistributionConfig.LOG_FILE_NAME, defaultLogFileName);
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); }
private long sizeOf(Object obj2estimate) { boolean isSeen = ObjectSizer.this.seen.containsKey(obj2estimate); ObjectSizer.this.seen.put(obj2estimate, null); return -sz;
@SuppressWarnings({ "unchecked", "rawtypes" }) public final Map<InternalDistributedMember, ReplyException> getExceptions() { if (this.exceptions != null) { synchronized (this) { return new THashMap((Map)this.exceptions); } } return null; }
/** * Compares this map with another map for equality of their stored * entries. * * @param other an <code>Object</code> value * @return a <code>boolean</code> value */ @Override // GemStoneAddition public boolean equals(Object other) { if (! (other instanceof Map)) { return false; } Map that = (Map)other; if (that.size() != this.size()) { return false; } return forEachEntry(new EqProcedure(that)); }
private static String getValue(THashMap ncjMetaData, int index) { Object val = ncjMetaData.get(index); if (val != null) { return (String)val; } return null; }
private static void addToTHashSet(THashMap ncjMetaData, int index, String val) { if (val == null) { SanityManager.THROWASSERT("Null not allowed for index=" + index); } final THashSet valSet; Object obj = ncjMetaData.get(index); if (obj == null) { valSet = new THashSet(Local.MAXTABLES.value); ncjMetaData.put(index, valSet); } else { valSet = (THashSet)obj; } valSet.add(val); }
private static void addIntValue(THashMap ncjMetaData, int index, int val) { ncjMetaData.put(index, val); }
@Override public final boolean execute(Object mbr, Object data) { THashMap memberData = (THashMap)((ArrayList<?>)data).get(0); Map<String, TObjectLongHashMapDSFID> memberEvents = eventsToBeDispatched.get(mbr); if (memberEvents != null && !memberEvents.isEmpty()) { // remove events that member itself sent final Set<?> primaryBuckets = memberEvents.keySet(); for (Object b : primaryBuckets) { memberData.remove(b); } } // populate all other bucket data final THashMap.EntryIterator miter = memberData .entryIterator(); while (miter.hasNext()) { Object map = tailKeys.get(miter.nextKey()); if (map != null) { miter.setValueAtCurrent(map); } } return true; } });
@Override public void postExecutionCallback() { // Check if the state of hosted buckets before execution is same as after // execution this.hostedBuckets.forEachEntry(postExecutionProc); }
public boolean remove(Object key) { return (null != THashMap.this.remove(key)); }
/** * copies the key/value mappings in <tt>map</tt> into this map. * * @param map a <code>Map</code> value */ public final void putAll(Map map) { ensureCapacity(map.size()); // could optimize this for cases when map instanceof THashMap for (Iterator i = map.entrySet().iterator(); i.hasNext();) { Map.Entry e = (Map.Entry)i.next(); put(e.getKey(),e.getValue()); } }
BackingStoreHashtableValues() { memoryIterator = hash_table.values().iterator(); }