Publishes the keyed stream as a queryable ValueState instance.

@param queryableStateName Name under which to the publish the queryable state instance
@param stateDescriptor State descriptor to create state instance from
@return Queryable state instance
345329
@PublicEvolving
	public QueryableStateStream<KEY, T> asQueryableState(
			String queryableStateName,
			ValueStateDescriptor<T> stateDescriptor) {

		transform("Queryable state: " + queryableStateName,
				getType(),
				new QueryableValueStateOperator<>(queryableStateName, stateDescriptor));

		stateDescriptor.initializeSerializerUnlessSet(getExecutionConfig());

		return new QueryableStateStream<>(
				queryableStateName,
				stateDescriptor,
				getKeyType().createSerializer(getExecutionConfig()));
	}
756954
@Override
	public TopicSubscriber createDurableSubscriber(Topic topic, String subscriptionName, String messageSelector, boolean noLocal) throws JMSException
    {
    	return createDurableSubscriber(idProvider.createID(), topic, subscriptionName, messageSelector, noLocal);
    }
1137026
@SuppressWarnings("unchecked")
	@Override
	public <K, V> BroadcastState<K, V> getBroadcastState(final MapStateDescriptor<K, V> stateDescriptor) throws StateMigrationException {

		Preconditions.checkNotNull(stateDescriptor);
		String name = Preconditions.checkNotNull(stateDescriptor.getName());

		BackendWritableBroadcastState<K, V> previous =
			(BackendWritableBroadcastState<K, V>) accessedBroadcastStatesByName.get(name);

		if (previous != null) {
			checkStateNameAndMode(
					previous.getStateMetaInfo().getName(),
					name,
					previous.getStateMetaInfo().getAssignmentMode(),
					OperatorStateHandle.Mode.BROADCAST);
			return previous;
		}

		stateDescriptor.initializeSerializerUnlessSet(getExecutionConfig());
		TypeSerializer<K> broadcastStateKeySerializer = Preconditions.checkNotNull(stateDescriptor.getKeySerializer());
		TypeSerializer<V> broadcastStateValueSerializer = Preconditions.checkNotNull(stateDescriptor.getValueSerializer());

		BackendWritableBroadcastState<K, V> broadcastState =
			(BackendWritableBroadcastState<K, V>) registeredBroadcastStates.get(name);

		if (broadcastState == null) {
			broadcastState = new HeapBroadcastState<>(
					new RegisteredBroadcastStateBackendMetaInfo<>(
							name,
							OperatorStateHandle.Mode.BROADCAST,
							broadcastStateKeySerializer,
							broadcastStateValueSerializer));
			registeredBroadcastStates.put(name, broadcastState);
		} else {
			// has restored state; check compatibility of new state access

			checkStateNameAndMode(
					broadcastState.getStateMetaInfo().getName(),
					name,
					broadcastState.getStateMetaInfo().getAssignmentMode(),
					OperatorStateHandle.Mode.BROADCAST);

			RegisteredBroadcastStateBackendMetaInfo<K, V> restoredBroadcastStateMetaInfo = broadcastState.getStateMetaInfo();

			// check whether new serializers are incompatible
			TypeSerializerSchemaCompatibility<K> keyCompatibility =
				restoredBroadcastStateMetaInfo.updateKeySerializer(broadcastStateKeySerializer);
			if (keyCompatibility.isIncompatible()) {
				throw new StateMigrationException("The new key typeSerializer for broadcast state must not be incompatible.");
			}

			TypeSerializerSchemaCompatibility<V> valueCompatibility =
				restoredBroadcastStateMetaInfo.updateValueSerializer(broadcastStateValueSerializer);
			if (valueCompatibility.isIncompatible()) {
				throw new StateMigrationException("The new value typeSerializer for broadcast state must not be incompatible.");
			}

			broadcastState.setStateMetaInfo(restoredBroadcastStateMetaInfo);
		}

		accessedBroadcastStatesByName.put(name, broadcastState);
		return broadcastState;
	}
166507
@Override
    //Thsi is dummy method. Liberty does not use this class.
    public ConsumerKey createSubscriptionConsumerDispatcherAndAttachCP(LocalConsumerPoint consumerPoint, ConsumerDispatcherState subState) throws SIDiscriminatorSyntaxException, SISelectorSyntaxException, SIResourceException, SINonDurableSubscriptionMismatchException, SINotPossibleInCurrentConfigurationException, SIDestinationLockedException, SISessionDroppedException {
        return null;
    }
934059
@Override
    public  org.openrdf.model.Statement createObjectProperty(QualifiedName subject, 
                                                             QualifiedName pred,
                                                             QualifiedName object) {
	return new StatementImpl(qualifiedNameToResource(subject), 
	                         qualifiedNameToURI(pred),
				 qualifiedNameToResource(object));
    }
1364784
@Override
    public ConsumableKey attachToDurableSubscription(
                                                     LocalConsumerPoint consumerPoint,
                                                     ConsumerDispatcherState subState)
                    throws SIDurableSubscriptionMismatchException, SIDurableSubscriptionNotFoundException, SIDestinationLockedException, SISelectorSyntaxException, SIDiscriminatorSyntaxException, SINotPossibleInCurrentConfigurationException, SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(
                        tc,
                        "attachToDurableSubscription",
                        new Object[] { consumerPoint, subState });

        ConsumableKey result =
                        _pubSubRealization.attachToDurableSubscription(
                                                                       consumerPoint,
                                                                       subState);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "attachToDurableSubscription", result);

        return result;
    }
1023513
function mapping (type, stateDefinitions, contractName) {
  var match = type.match(/mapping\((.*?)=>(.*)\)$/)
  var keyTypeName = match[1].trim()
  var valueTypeName = match[2].trim()

  var keyType = parseType(keyTypeName, stateDefinitions, contractName, 'storage')
  var valueType = parseType(valueTypeName, stateDefinitions, contractName, 'storage')

  var underlyingTypes = {
    'keyType': keyType,
    'valueType': valueType
  }
  return new MappingType(underlyingTypes, 'location', util.removeLocation(type))
}
865951
public Statement getGenericStatement(ClassDescriptor cds, boolean scrollable) throws PersistenceBrokerException
    {
        try
        {
            return cds.getStatementsForClass(m_conMan).getGenericStmt(m_conMan.getConnection(), scrollable);
        }
        catch (LookupException e)
        {
            throw new PersistenceBrokerException("Used ConnectionManager instance could not obtain a connection", e);
        }
    }
389902
public static void createRemoteDurableSubscription(
    MessageProcessor MP,
    ConsumerDispatcherState subState,
    SIBUuid8 remoteMEUuid,
    SIBUuid12 destinationID) 
    throws SIDurableSubscriptionAlreadyExistsException,
           SIResourceException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "createRemoteDurableSubscription", new Object[] { MP, subState, remoteMEUuid, destinationID });

    // Issue the request via the DurableInputHandler
    int status = issueCreateDurableRequest(MP, subState, remoteMEUuid, destinationID);

    switch (status)
    {
      case DurableConstants.STATUS_SUB_ALREADY_EXISTS:
      {      
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          SibTr.exit(tc, "createRemoteDurableSubscription", "SIDurableSubscriptionAlreadyExistsException");
        throw new SIDurableSubscriptionAlreadyExistsException(
          nls.getFormattedMessage(
            "SUBSCRIPTION_ALREADY_EXISTS_ERROR_CWSIP0143",
            new Object[] {subState.getSubscriberID(),
                          subState.getDurableHome()},
            null));
      }
      case DurableConstants.STATUS_SUB_GENERAL_ERROR:
      {  
        // Problem on other side which should be logged, best we      
        // can do is throw an exception here.
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
          SibTr.exit(tc, "createRemoteDurableSubscription", "SIErrorException");
          
        SibTr.error(tc,"INTERNAL_MESSAGING_ERROR_CWSIP0001",
          new Object[] {
            "com.ibm.ws.sib.processor.impl.DurableInputHandler",
            "1:955:1.52.1.1" });  
            
        throw new SIErrorException(
          nls.getFormattedMessage(
            "INTERNAL_MESSAGING_ERROR_CWSIP0001",
            new Object[] {
              "com.ibm.ws.sib.processor.impl.DurableInputHandler",
              "1:962:1.52.1.1" },
            null));
      }
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "createRemoteDurableSubscription");
  }
926439
function(newState){

    // when called with no args, it's a getter
    if (arguments.length === 0) {
      return this._currentState.stateName;
    }

    // activate by name
    if(typeof newState == 'string'){

      this._activateStateNamed(newState);

    // activate by index
    } else if (typeof newState == 'number'){

      this._activateState(this._states[newState]);
    }

    return this;
  }
605166
private SSMgr findStaticStateManager(Class<?> clazz) {
		try {
			Field stateManagerField = clazz.getField(Constants.fStaticFieldsName);
			if (stateManagerField == null) {
				throw new IllegalStateException("Cant find field accessor for type "
						+ typeDescriptor.getReloadableType().getName());
			}
			SSMgr stateManager = (SSMgr) stateManagerField.get(null);
			// Field should always have been initialized - it is done at the start of the top most reloadable type <clinit>
			if (stateManager == null) {
				throw new IllegalStateException("Instance of this class has no state manager: " + clazz.getName());
			}
			return stateManager;
		}
		catch (Exception e) {
			throw new IllegalStateException("Unexpectedly unable to find static state manager on class "
					+ clazz.getName(), e);
		}
	}
913774
@Override
    public void createDurableSubscription(ConsumerDispatcherState subState, TransactionCommon transaction) throws SIDurableSubscriptionAlreadyExistsException, SIDiscriminatorSyntaxException, SISelectorSyntaxException, SIResourceException
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(tc, "createDurableSubscription", new Object[] { subState, transaction });

        _targetDestinationHandler.createDurableSubscription(subState,
                                                            transaction);

        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(tc, "createDurableSubscription");
    }
77796
public void createStateModelBinding(final TransitionableState state, final String modelName, final Class modelType) {
        state.getAttributes().put("model", createExpression(modelName, modelType));
    }
576464
protected <S extends State> S getPartitionedState(StateDescriptor<S, ?> stateDescriptor) throws Exception {
		return getPartitionedState(VoidNamespace.INSTANCE, VoidNamespaceSerializer.INSTANCE, stateDescriptor);
	}
691662
public int registerNewSubscribedShardState(KinesisStreamShardState newSubscribedShardState) {
		synchronized (checkpointLock) {
			subscribedShardsState.add(newSubscribedShardState);

			// If a registered shard has initial state that is not SENTINEL_SHARD_ENDING_SEQUENCE_NUM (will be the case
			// if the consumer had already finished reading a shard before we failed and restored), we determine that
			// this subtask has a new active shard
			if (!newSubscribedShardState.getLastProcessedSequenceNum().equals(SentinelSequenceNumber.SENTINEL_SHARD_ENDING_SEQUENCE_NUM.get())) {
				this.numberOfActiveShards.incrementAndGet();
			}

			int shardStateIndex = subscribedShardsState.size() - 1;

			// track all discovered shards for watermark determination
			ShardWatermarkState sws = shardWatermarks.get(shardStateIndex);
			if (sws == null) {
				sws = new ShardWatermarkState();
				try {
					sws.periodicWatermarkAssigner = InstantiationUtil.clone(periodicWatermarkAssigner);
				} catch (Exception e) {
					throw new RuntimeException("Failed to instantiate new WatermarkAssigner", e);
				}
				sws.lastUpdated = getCurrentTimeMillis();
				sws.lastRecordTimestamp = Long.MIN_VALUE;
				shardWatermarks.put(shardStateIndex, sws);
			}

			return shardStateIndex;
		}
	}
144843
public static QueryableStateConfiguration fromConfiguration(Configuration config) {
		if (!config.getBoolean(QueryableStateOptions.ENABLE_QUERYABLE_STATE_PROXY_SERVER)) {
			return null;
		}

		final Iterator<Integer> proxyPorts = NetUtils.getPortRangeFromString(
			config.getString(QueryableStateOptions.PROXY_PORT_RANGE));
		final Iterator<Integer> serverPorts = NetUtils.getPortRangeFromString(
			config.getString(QueryableStateOptions.SERVER_PORT_RANGE));

		final int numProxyServerNetworkThreads = config.getInteger(QueryableStateOptions.PROXY_NETWORK_THREADS);
		final int numProxyServerQueryThreads = config.getInteger(QueryableStateOptions.PROXY_ASYNC_QUERY_THREADS);

		final int numStateServerNetworkThreads = config.getInteger(QueryableStateOptions.SERVER_NETWORK_THREADS);
		final int numStateServerQueryThreads = config.getInteger(QueryableStateOptions.SERVER_ASYNC_QUERY_THREADS);

		return new QueryableStateConfiguration(
			proxyPorts,
			serverPorts,
			numProxyServerNetworkThreads,
			numProxyServerQueryThreads,
			numStateServerNetworkThreads,
			numStateServerQueryThreads);
	}
246224
@Action(
            semantics = SemanticsOf.IDEMPOTENT,
            publishing = Publishing.ENABLED
    )
    @ActionLayout(
            describedAs = "Updates name, description and count as sub-actions"
    )
    public PublishMqDemoObject updateNameAndDescriptionAndCount(
            @ParameterLayout(named="Name")
            final String name,
            @Parameter(optionality = Optionality.OPTIONAL)
            @ParameterLayout(named="Description")
            final String description,
            @Parameter(optionality = Optionality.OPTIONAL)
            @ParameterLayout(named="Count")
            final Integer count) {
        wrapperFactory.wrap(this).updateName(name);
        wrapperFactory.wrap(this).updateDescription(description);
        wrapperFactory.wrap(this).updateCount(count);
        return this;
    }