/*
For counter columns, we must know when we deserialize them if what we
deserialize comes from a remote host. If it does, then we must clear
the delta.
500817
public Cell deserialize(DataInput in, ColumnSerializer.Flag flag) throws IOException
    {
        return deserialize(in, flag, Integer.MIN_VALUE);
    }
453195
public void clearInputs() {
        unCache();
        for (TransactionInput input : inputs) {
            input.setParent(null);
        }
        inputs.clear();
        // You wanted to reserialize, right?
        this.length = this.unsafeBitcoinSerialize().length;
    }
151715
boolean cleanupLocalisations() throws SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "cleanupLocalisations");

        // true if all localisations have been cleaned up successfully
        boolean allCleanedUp = true;

        // True if we determine calling reallocation is appropriate
        boolean reallocationCanBeCalled = false;

        //Check the destination has not already been deleted first
        if (!isDeleted())
        {
            synchronized (this) //Stop cleanup happening while the destination is being altered
            {
                //synchronizes with updateLocalisationSet
                //If the entire destination is to be deleted
                //then all the localisations are to be deleted.
                // 448943 Remove a check for !isReconciled - We dont need this
                if (isToBeDeleted())
                {
                    addAllLocalisationsForCleanUp();
                }

                allCleanedUp = _protoRealization.cleanupPremediatedItemStreams();

                if (!isPubSub())
                {
                    //If the entire destination is being deleted, clean up the remote get
                    //infrastructure
                    if (isToBeDeleted())
                    {
                        boolean remoteGetCleanup = _ptoPRealization.cleanupLocalisations();
                        if (allCleanedUp)
                            allCleanedUp = remoteGetCleanup;
                    }
                    else
                    {
                        // PK57432 We are not deleting the destination. Just perform
                        // any other localisation cleanup
                        reallocationCanBeCalled = true;
                    }
                }
                else
                {
                    // For pub/sub, we'll want to remove any infrastructure associated with
                    // durable subscriptions since these are implemented as queue-like localizations.
                    if (isToBeDeleted())
                    {
                        boolean pubSubCleanedUp = _pubSubRealization.cleanupLocalisations();
                        if (allCleanedUp)
                            allCleanedUp = pubSubCleanedUp;
                    }
                    else
                    {
                        // We are not deleting the destination. Just perform
                        // any other localisation cleanup
                        reallocationCanBeCalled = true;
                    }
                }

            }
        }

        // PK57432 We must not hold any locks when we reallocate.
        if (reallocationCanBeCalled)
        {
            boolean syncReallocRequiredCheck;
            synchronized (this) {
                syncReallocRequiredCheck = _isToBeReallocated;
                _isToBeReallocated = false;
            }
            if (syncReallocRequiredCheck)
                reallocateTransmissionStreams(null);
        }

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "cleanupLocalisations", Boolean.valueOf(allCleanedUp));

        return allCleanedUp;
    }
269164
static void skipSerializedStates(DataInputView in) throws IOException {
		TypeSerializer<String> nameSerializer = StringSerializer.INSTANCE;
		TypeSerializer<State.StateType> stateTypeSerializer = new EnumSerializer<>(State.StateType.class);
		TypeSerializer<StateTransitionAction> actionSerializer = new EnumSerializer<>(StateTransitionAction.class);

		final int noOfStates = in.readInt();

		for (int i = 0; i < noOfStates; i++) {
			nameSerializer.deserialize(in);
			stateTypeSerializer.deserialize(in);
		}

		for (int i = 0; i < noOfStates; i++) {
			String srcName = nameSerializer.deserialize(in);

			int noOfTransitions = in.readInt();
			for (int j = 0; j < noOfTransitions; j++) {
				String src = nameSerializer.deserialize(in);
				Preconditions.checkState(src.equals(srcName),
					"Source Edge names do not match (" + srcName + " - " + src + ").");

				nameSerializer.deserialize(in);
				actionSerializer.deserialize(in);

				try {
					skipCondition(in);
				} catch (ClassNotFoundException e) {
					e.printStackTrace();
				}
			}
		}
	}
583683
public void clear() {
        if (mCardNumberEditText.hasFocus()
                || mExpiryDateEditText.hasFocus()
                || mCvcNumberEditText.hasFocus()
                || this.hasFocus()) {
            mCardNumberEditText.requestFocus();
        }
        mCvcNumberEditText.setText("");
        mExpiryDateEditText.setText("");
        mCardNumberEditText.setText("");
    }
1196400
@Override
    public void clear() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
            Tr.debug(tc, "Clearing ISC: " + this);
        }
        super.clear();
        this.bCheckedAcceptEncoding = false;
        this.bContainsLargeMessage = false;
        this.remoteUser = "";
        this.forwardedHeaderInitialized = false;
        this.forwardedHost = null;
        this.forwardedProto = null;
        this.forwardedRemoteAddress = null;
        this.forwardedRemotePort = -1;
        if (getHttpConfig().runningOnZOS()) {
            // @311734 - clean the statemap of the final write mark
            getVC().getStateMap().remove(HttpConstants.FINAL_WRITE_MARK);
        }
    }
72294
@Override
    public void clear() {
        if (mSize != 0) {
            freeArrays(mHashes, mArray, mSize);
            mHashes = ContainerHelpers.EMPTY_INTS;
            mArray = ContainerHelpers.EMPTY_OBJECTS;
            mSize = 0;
        }
    }
521633
private void removeDominatedColumns(DoubleMatrix1D c,
			DoubleMatrix2D A, DoubleMatrix1D b, 
			DoubleMatrix1D lb, DoubleMatrix1D ub, 
			DoubleMatrix1D ylb, DoubleMatrix1D yub,
			DoubleMatrix1D zlb, DoubleMatrix1D zub) {
		for(short col=0; col<this.vColPositions.length; col++){
			short[] vColPositionsCol = vColPositions[col];
			if(vColPositionsCol==null || vColPositionsCol.length==0){
				continue;
			}
			double e = 0.;
			double d = 0.;
			//it will be e <= d
			for(int i=0; i<vColPositionsCol.length; i++){
				short row = vColPositionsCol[i]; 
				double AIJ = A.getQuick(row, col);
				if(AIJ > 0){
					e += AIJ * ylb.getQuick(row); 
					d += AIJ * yub.getQuick(row);
				}else{
					e += AIJ * yub.getQuick(row); 
					d += AIJ * ylb.getQuick(row);
				}
			}
			
			double cmd = c.getQuick(col) - d;
			double cme = c.getQuick(col) - e;
			//logger.debug("cmd: " +cmd);
			//logger.debug("cme: " +cme);
			boolean isCmdPositive = cmd > 0 && !isZero(cmd);//strictly > 0
			boolean isCmeNegative = cme < 0 && !isZero(cme);//strictly < 0
			boolean isLBColUnbounded = isLBUnbounded(lb.getQuick(col));
			boolean isUBColUnbounded = isUBUnbounded(ub.getQuick(col));
			
			if(isCmdPositive || isCmeNegative){
			  //dominated column
				log.debug("found dominated column: " + col);
				if(isCmdPositive){
					zlb.setQuick(col, 0);
					if(isLBColUnbounded){
						log.debug("unbounded problem");
						throw new RuntimeException("unbounded problem");
					}
					ub.setQuick(col, lb.getQuick(col));
					log.debug("x[" + col + "]="+lb.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, lb.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
				}else if(isCmeNegative){
					zub.setQuick(col, 0);
					if(isUBColUnbounded){
						log.debug("unbounded problem");
						throw new RuntimeException("unbounded problem");
					}
					lb.setQuick(col, ub.getQuick(col));
					log.debug("x[" + col + "]="+ub.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, ub.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
				}
				continue;
			}
			
			//here we have cmd<=0 and cme>=0 (can even be unbounded)
			
			if(vColPositionsCol.length>1){//the column singletons are used to generate the bounds d and e and therefore they cannot be dropped with this test
				if(!isLBColUnbounded && isZero(cmd)){	
					//weakly dominated column, see A. & A. (27), (28)
					log.debug("found weakly dominated column: " + col);
					ub.setQuick(col, lb.getQuick(col));
					log.debug("x[" + col + "]="+lb.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, lb.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
					continue;
				}
				if(!isUBColUnbounded && isZero(cme)){	
					//weakly dominated column, see A. & A. (27), (28)
					log.debug("found weakly dominated column: " + col);
					lb.setQuick(col, ub.getQuick(col));
					log.debug("x[" + col + "]="+ub.getQuick(col));
					addToPresolvingStack(new LinearDependency(col, null, null, ub.getQuick(col)));
					pruneFixedVariable(col, c, A, b, lb, ub, ylb, yub, zlb, zub);
					continue;
				}
			}
			
			if(!isLBColUnbounded && isUBColUnbounded){
				//new bounds on the optimal Lagrange multipliers y
				for(int i=0; i<vColPositionsCol.length; i++){
					short row = vColPositionsCol[i]; 
					double AIJ = A.getQuick(row, col);
					if(AIJ > 0){
						if(!isUBUnbounded(cme/AIJ + ylb.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							yub.setQuick(row, Math.min(yub.getQuick(row), cme/AIJ + ylb.getQuick(row)));
						}
					}else{
						if(!isLBUnbounded(cme/AIJ + yub.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							ylb.setQuick(row, Math.max(ylb.getQuick(row), cme/AIJ + yub.getQuick(row)));
						}
					}
				}
			}
			if(isLBColUnbounded && !isUBColUnbounded){
			  //new bounds on the optimal Lagrange multipliers y
				for(int i=0; i<vColPositionsCol.length; i++){
					short row = vColPositionsCol[i]; 
					double AIJ = A.getQuick(row, col);
					if(AIJ > 0){
						if(!isLBUnbounded(cmd/AIJ + yub.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							ylb.setQuick(row, Math.max(ylb.getQuick(row), cmd/AIJ + yub.getQuick(row)));
						}
					}else{
						if(!isUBUnbounded(cmd/AIJ + ylb.getQuick(row))){
							log.debug("set new bounds on the optimal Lagrange multipliers: " + row);
							yub.setQuick(row, Math.min(yub.getQuick(row), cmd/AIJ + ylb.getQuick(row)));
						}
					}
				}
			}
		}
	}
989442
function deserialize (value, columnDefinitions) {

    var deserializedValue = {};
    
    try {
        Validate.notNull(columnDefinitions, 'columnDefinitions');
        Validate.isObject(columnDefinitions);

        Validate.notNull(value);
        Validate.isObject(value);

        for (var property in value) {
            var columnName = storeHelper.getColumnName(columnDefinitions, property); // this helps us deserialize with proper case for the property name
            deserializedValue[columnName] = deserializeMember(value[property], storeHelper.getColumnType(columnDefinitions, property));
        }
        
    } catch (error) {
        throw new verror.VError(error, 'Failed to deserialize value ' + JSON.stringify(value) + '. Column definitions: ' + JSON.stringify(columnDefinitions));
    }

    return deserializedValue;
}
788430
private void cleanup_heartbeat_proxies() {
        // disconnect the pushsupplier to stop receiving events
        Enumeration keys = event_callback_map.keys();
        while (keys.hasMoreElements()) {
            String name = (String) keys.nextElement();
            EventCallBackStruct callback_struct = event_callback_map.get(name);
            try {
                EventChannelStruct ec_struct = channel_map.get(callback_struct.channel_name);
                if (ec_struct.structuredProxyPushSupplier != null) {
                    //System.out.println("Disconnect " + callback_struct.channel_name);
                    ec_struct.structuredProxyPushSupplier.disconnect_structured_push_supplier();
                    ec_struct.structuredProxyPushSupplier = null;
                }
            } catch (Exception e) {
                System.out.println(e);
            }
            event_callback_map.remove(name);
        }
    }
348738
public static void pruneDenseTableColumnsV2(List<RawColumn> columns) {
    ListIterator<RawColumn> iterator = columns.listIterator();
    while (iterator.hasNext()) {
      RawColumn column = iterator.next();
      if (column.kind.equals(KIND_COMPACT_VALUE) && column.name.asInternal().isEmpty()) {
        iterator.remove();
      }
    }
  }
872351
protected void releaseTable() {
		// set the counters back
		this.numBuckets = 0;
		
		if (this.buckets != null) {
			for (MemorySegment bucket : this.buckets) {
				this.availableMemory.add(bucket);
			}
			this.buckets = null;
		}
	}
756590
private boolean eligibleToFetch(List<String> columnsToSelect, String columnName)
    {
        return (columnsToSelect != null && !columnsToSelect.isEmpty() && columnsToSelect.contains(columnName))
                || (columnsToSelect == null || columnsToSelect.isEmpty());
    }
68936
@Override
  public boolean removeEldestEntry(Map.Entry eldest) {
    boolean mustBeRemoved = this.size() > maxSize;

    if (mustBeRemoved) {
      ServerPrepareResult serverPrepareResult = ((ServerPrepareResult) eldest.getValue());
      serverPrepareResult.setRemoveFromCache();
      if (serverPrepareResult.canBeDeallocate()) {
        try {
          protocol.forceReleasePrepareStatement(serverPrepareResult.getStatementId());
        } catch (SQLException e) {
          //eat exception
        }
      }
    }
    return mustBeRemoved;
  }
327315
public function clear()
    {
        $this->map = array();
        $this->namedCriterions = array();
        $this->ignoreCase = false;
        $this->singleRecord = false;
        $this->selectModifiers = array();
        $this->selectColumns = array();
        $this->orderByColumns = array();
        $this->groupByColumns = array();
        $this->having = null;
        $this->asColumns = array();
        $this->joins = array();
        $this->selectQueries = array();
        $this->dbName = $this->originalDbName;
        $this->offset = 0;
        $this->limit = 0;
        $this->blobFlag = null;
        $this->aliases = array();
        $this->useTransaction = false;
        $this->conditionalProxy = null;
        $this->defaultCombineOperator = Criteria::LOGICAL_AND;
        $this->primaryTableName = null;
        $this->queryComment = null;

    }
232139
public void closeTx() {

        //Clear Collection Caches
        modifiedThings.clear();
        modifiedRoles.clear();
        modifiedRelationTypes.clear();
        modifiedRules.clear();
        modifiedCastings.clear();
        newAttributes.clear();
        newRelations.clear();
        shardingCount.clear();
        conceptCache.clear();
        schemaConceptCache.clear();
        labelCache.clear();
    }
1128587
@Override
    public final void clearReplyFields() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "clearReplyFields");
        getApi().setChoiceField(JsApiAccess.REPLYDISCRIMINATOR, JsApiAccess.IS_REPLYDISCRIMINATOR_UNSET);
        getApi().setChoiceField(JsApiAccess.REPLYPRIORITY, JsApiAccess.IS_REPLYPRIORITY_UNSET);
        getApi().setChoiceField(JsApiAccess.REPLYRELIABILITY, JsApiAccess.IS_REPLYRELIABILITY_UNSET);
        getApi().setChoiceField(JsApiAccess.REPLYTIMETOLIVE, JsApiAccess.IS_REPLYTIMETOLIVE_UNSET);
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "clearReplyFields");
    }