public void unregisterClientNetworkEntity(int netId) { netIdToEntityId.remove(netId); }
public long remove( int key ) { synchronized( mutex ) { return m.remove( key ); } } public void putAll( Map<? extends Integer, ? extends Long> map ) {
public void markTaskCompleted (int taskId) { if (tasksById.get(taskId) == null) { LOG.error("Tried to mark task {} completed, but it was not in job {}.", taskId, jobId); return; } if (invisibleUntil.remove(taskId) != 0) { // If the taskId was found in the invisibleUntil map, the task was delivered and has not been slated for // re-delivery. completedTasks.add(taskId); } else { // If the taskId was not found in the invisibleUntil map, the task was never delivered, or timed out and was // slated for redelivery. We should ignore the completion message and let the re-delivery proceed to avoid // problems with redelivered tasks overwriting results in S3 after the job is considered finished. // TODO verify that there are no race conditions here. LOG.warn("Ignoring late task completion message, task {} was queued for re-delivery."); } }
public void unregisterNetworkEntity(EntityRef entity) { if (mode != NetworkMode.CLIENT) { NetworkComponent netComponent = entity.getComponent(NetworkComponent.class); if (netComponent != null) { logger.debug("Unregistering network entity: {} with netId {}", entity, netComponent.getNetworkId()); netIdToEntityId.remove(netComponent.getNetworkId()); if (mode.isServer()) { for (NetClient client : netClientList) { client.setNetRemoved(netComponent.getNetworkId()); } } netComponent.setNetworkId(NULL_NET_ID); entity.saveComponent(netComponent); } } ownerLookup.remove(entity); }
/** * Deletes a key/value pair from the map. * * @param key an <code>Object</code> value * @return the removed value, or null if it was not found in the map */ public Long remove( Object key ) { int k; if ( key != null ) { if ( key instanceof Integer ) { k = unwrapKey( key ); } else { return null; } } else { k = _map.getNoEntryKey(); } long v = _map.remove( k ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
@Override public long remove( int key ) { synchronized( mutex ) { return m.remove( key ); } } @Override
public long remove( int key ) { synchronized( mutex ) { return m.remove( key ); } } public void putAll( Map<? extends Integer, ? extends Long> map ) {
public long remove( int key ) { synchronized( mutex ) { return m.remove( key ); } } public void putAll( Map<? extends Integer, ? extends Long> map ) {
public long remove( int key ) { synchronized( mutex ) { return m.remove( key ); } } public void putAll( Map<? extends Integer, ? extends Long> map ) {
@Override public final long setLong(int index, long value) { final long oldValue = codes.remove(index); if (value != defaultCode) { this.codes.put(index, value); } return oldValue; }
@Override public final Long setValue(int index, Long value) { this.checkBounds(index, length); final Long oldValue = getValue(index); if (value == null) { this.values.remove(index); return oldValue; } else { this.values.put(index,value); return oldValue; } }
@Override public final long setLong(int index, long value) { this.checkBounds(index, length); final long oldValue = getLong(index); if (value == defaultValue) { this.values.remove(index); return oldValue; } else { this.values.put(index, value); return oldValue; } }
@Override public final ZonedDateTime setValue(int index, ZonedDateTime value) { this.checkBounds(index, length); final ZonedDateTime oldValue = getValue(index); final long valueAsLong = value == null ? nullValue : value.toInstant().toEpochMilli(); if (valueAsLong == defaultValueAsLong) { this.values.remove(index); this.zoneIds.remove(index); return oldValue; } else { final short zoneId = value == null ? NULL_ZONE : zoneIdMap1.get(value.getZone()); this.values.put(index, valueAsLong); this.zoneIds.put(index, zoneId); return oldValue; } }
/** * Deletes a key/value pair from the map. * * @param key an <code>Object</code> value * @return the removed value, or null if it was not found in the map */ @Override public Long remove( Object key ) { if (! (key instanceof Integer ) ) { return null; } int k = unwrapKey( key ); if ( _map.containsKey( k ) ) { long v = _map.remove( k ); return wrapValue( v ); } return null; }
@Override public final T setValue(int index, T value) { this.checkBounds(index, length); final T oldValue = getValue(index); final long code = coding.getCode(value); if (code == defaultCode) { this.codes.remove(index); return oldValue; } else { this.codes.put(index, code); return oldValue; } }
/** * Deletes a key/value pair from the map. * * @param key an <code>Object</code> value * @return the removed value, or null if it was not found in the map */ public Long remove( Object key ) { int k; if ( key != null ) { if ( key instanceof Integer ) { k = unwrapKey( key ); } else { return null; } } else { k = _map.getNoEntryKey(); } long v = _map.remove( k ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
/** * Deletes a key/value pair from the map. * * @param key an <code>Object</code> value * @return the removed value, or null if it was not found in the map */ public Long remove( Object key ) { int k; if ( key != null ) { if ( key instanceof Integer ) { k = unwrapKey( key ); } else { return null; } } else { k = _map.getNoEntryKey(); } long v = _map.remove( k ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
/** * Deletes a key/value pair from the map. * * @param key an <code>Object</code> value * @return the removed value, or null if it was not found in the map */ public Long remove( Object key ) { int k; if ( key != null ) { if ( key instanceof Integer ) { k = unwrapKey( key ); } else { return null; } } else { k = _map.getNoEntryKey(); } long v = _map.remove( k ); // There may be a false positive since primitive maps // cannot return null, so we have to do an extra // check here. if ( v == _map.getNoEntryValue() ) { return null; } else { return wrapValue( v ); } }
@Override public final long setLong(int index, long value) { this.checkBounds(index, length); final long oldValue = getLong(index); if (value == defaultValueAsLong) { this.values.remove(index); this.zoneIds.remove(index); return oldValue; } else { final short zoneId = zoneIds.get(index); this.values.put(index, value); this.zoneIds.put(index, zoneId != NULL_ZONE ? zoneId : UTC_ZONE); return oldValue; } }
@Override public final Array<ZonedDateTime> swap(int i, int j) { final long v1 = values.get(i); final long v2 = values.get(j); final short z1 = zoneIds.get(i); final short z2 = zoneIds.get(j); if (v1 == defaultValueAsLong) { this.values.remove(j); this.zoneIds.remove(j); } else { this.values.put(j, v1); this.zoneIds.put(j, z1); } if (v2 == defaultValueAsLong) { this.values.remove(i); this.zoneIds.remove(i); } else { this.values.put(i, v2); this.zoneIds.put(i, z2); } return this; }