@Override public HTTPClientConfig setResponseQueueLength(int value) { this.pcm.ensureSize(NetResponseSchema.class, value, 32); return this; }
@Override public HTTPClientConfig setMaxRequestSize(int value) { this.pcm.ensureSize(NetPayloadSchema.class, 4, value); //System.out.println("set max size: "+value+" maxVar:"+pcm.getConfig(NetPayloadSchema.class).maxVarLenSize()+" "+pcm.getConfig(NetPayloadSchema.class)); return this; }
@Override public HTTPClientConfig setMaxResponseSize(int value) { //System.out.println("response size: "+value); this.pcm.ensureSize(NetResponseSchema.class, 4, value); return this; }
@Override public HTTPServerConfig setMaxResponseSize(int maxResponseSize) { pcmOut.ensureSize(ServerResponseSchema.class, 4, maxResponseSize); //logger.info("\nsetting the max response size for {} to {}", ServerResponseSchema.class, maxResponseSize); this.maxResponseSize = maxResponseSize; return this; }
@Override public HTTPClientConfig setRequestQueueLength(int value) { this.pcm.ensureSize(NetPayloadSchema.class, value, 32); return this; }
public void ensureServerCanWrite(int length) { pcmOut.ensureSize(NetPayloadSchema.class, 0, length); }
@Override public HTTPServerConfig setMaxQueueIn(int maxQueueIn) { this.maxQueueIn = Math.max(this.maxQueueIn, maxQueueIn); //for after router and before module, limited since all the data is cached in previous pipe //and we do not want to use all the memory here. this.pcmIn.ensureSize(HTTPRequestSchema.class, Math.max(maxQueueIn,1<<12), 0); return this; }
public PubSubService(MsgCommandChannel<?> msgCommandChannel, int queueLength, int maxMessageSize) { this.msgCommandChannel = msgCommandChannel; MsgCommandChannel.growCommandCountRoom(msgCommandChannel, queueLength); msgCommandChannel.initFeatures |= MsgCommandChannel.DYNAMIC_MESSAGING; msgCommandChannel.pcm.ensureSize(MessagePubSub.class, queueLength, maxMessageSize); //also ensure consumers have pipes which can consume this. msgCommandChannel.pcm.ensureSize(MessageSubscription.class, queueLength, maxMessageSize); //IngressMessages Confirm that MQTT ingress is big enough as well msgCommandChannel.pcm.ensureSize(IngressMessages.class, queueLength, maxMessageSize); msgCommandChannel.builder.messageRoutingRequired(); }
public PubSubFixedTopicService(MsgCommandChannel<?> msgCommandChannel, String baseTopic, String trackTopic, int queueLength, int maxMessageSize) { msgCommandChannel.initFeatures |= MsgCommandChannel.DYNAMIC_MESSAGING; this.msgCommandChannel = msgCommandChannel; this.topic = trackTopic; this.topicBytes = topic.getBytes(); MsgCommandChannel.growCommandCountRoom(msgCommandChannel, queueLength); //NOTE: must set private topics in case we choose this msgCommandChannel.pcm.ensureSize(MessagePrivate.class, queueLength, maxMessageSize); //NOTE: must set public topics in case we choose this msgCommandChannel.pcm.ensureSize(MessagePubSub.class, queueLength, maxMessageSize); //also ensure consumers have pipes which can consume this. msgCommandChannel.pcm.ensureSize(MessageSubscription.class, queueLength, maxMessageSize); //IngressMessages Confirm that MQTT ingress is big enough as well msgCommandChannel.pcm.ensureSize(IngressMessages.class, queueLength, maxMessageSize); msgCommandChannel.builder.possiblePrivateTopicProducer(msgCommandChannel, baseTopic, msgCommandChannel.parallelInstanceId); }
public HTTPResponseService(MsgCommandChannel<?> msgCommandChannel) { this.msgCommandChannel = msgCommandChannel; msgCommandChannel.initFeatures |= MsgCommandChannel.NET_RESPONDER; msgCommandChannel.pcm.ensureSize(ServerResponseSchema.class, 1, minHeader); assert(setupValidator()); //TODO: need to write response type and JSON back to HTTPRouterStageConfig.... //TODO: where does th router stage config live? // msgCommandChannel.builder.getHTTPServerConfig(). }
pcmIn.ensureSize(ReleaseSchema.class, releaseMsg, 0); pcmOut.ensureSize(ReleaseSchema.class, releaseMsg, 0); pcmIn.ensureSize(NetPayloadSchema.class, partialPartsIn, Math.max(maxRequestSize, isTLS ? (Math.max(blockSize, SSLUtil.MinTLSBlock)) : blockSize pcmIn.ensureSize(HTTPRequestSchema.class, queueLengthIn, fromRouterToModuleBlob); pcmOut.ensureSize(NetPayloadSchema.class, queueLengthOut, maxResponseSize);
public HTTPRequestService(MsgCommandChannel<?> msgCommandChannel, int queueLength, int maxMessageSize) { this.msgCommandChannel = msgCommandChannel; if (msgCommandChannel.builder.getHTTPClientConfig().isTLS()) { //TLS must have at lest 33305 int tlsBody = Math.max(SSLUtil.MinTLSBlock, maxMessageSize); int tlsLen = Math.max(Math.min(queueLength, (1<<27)/tlsBody),4); msgCommandChannel.pcm.ensureSize(ClientHTTPRequestSchema.class, tlsLen, tlsBody); } else { msgCommandChannel.pcm.ensureSize(ClientHTTPRequestSchema.class, queueLength, maxMessageSize); } MsgCommandChannel.growCommandCountRoom(msgCommandChannel, queueLength); msgCommandChannel.initFeatures |= MsgCommandChannel.NET_REQUESTER; }
public HTTPServerConfigImpl(int bindPort, PipeConfigManager pcmIn, PipeConfigManager pcmOut, StructRegistry recordTypeData) { this.bindPort = bindPort; if (bindPort<=0 || (bindPort>=(1<<16))) { throw new UnsupportedOperationException("invalid port "+bindPort); } this.pcmIn = pcmIn; this.pcmOut = pcmOut; //NOTE: this is set at the minimum sizes to support example, template and favicon.ico files this.pcmOut.ensureSize(ServerResponseSchema.class, 4, Math.max(ICO_FILE_SIZE, maxResponseSize)); this.scs = new ServerConnectionStruct(recordTypeData); beginDeclarations(); }
/** * * @param msgCommandChannel MsgCommandChannel arg used in * @param queueLength int arg specifying que length * @param maxMessageSize int arg specifying max message size */ public HTTPResponseService(MsgCommandChannel<?> msgCommandChannel, int queueLength, int maxMessageSize) { this.msgCommandChannel = msgCommandChannel; MsgCommandChannel.growCommandCountRoom(msgCommandChannel, queueLength); msgCommandChannel.initFeatures |= MsgCommandChannel.NET_RESPONDER; msgCommandChannel.pcm.ensureSize(ServerResponseSchema.class, queueLength, Math.max(minHeader, maxMessageSize)); assert(setupValidator()); }
public HTTPRequestService(MsgCommandChannel<?> msgCommandChannel) { this.msgCommandChannel = msgCommandChannel; if (msgCommandChannel.builder.getHTTPClientConfig().isTLS()) { msgCommandChannel.pcm.ensureSize(ClientHTTPRequestSchema.class, 4, SSLUtil.MinTLSBlock); } msgCommandChannel.initFeatures |= MsgCommandChannel.NET_REQUESTER; }
private static MQTTConfigImpl buildMQTTBridge(GraphManager gm, CharSequence host, int port, CharSequence clientId, int maxInFlight, int maxMessageLength, PipeConfigManager localPCM, long rate) { ClientCoordinator.registerDomain(host); if (maxInFlight>(1<<15)) { throw new UnsupportedOperationException("Does not suppport more than "+(1<<15)+" in flight"); } if (maxMessageLength>(256*(1<<20))) { throw new UnsupportedOperationException("Specification does not support values larger than 256M"); } localPCM.ensureSize(MessageSubscription.class, maxInFlight, maxMessageLength); MQTTConfigImpl mqttBridge = new MQTTConfigImpl(host, port, clientId, gm, rate, (short)maxInFlight, maxMessageLength); mqttBridge.beginDeclarations(); return mqttBridge; }
new SocketValidator(), false/*Do not grow*/); serverPipesConfig.pcmIn.ensureSize(HTTPRequestSchema.class, serverPipesConfig.fromRouterToModuleCount, this.connectionStruct().inFlightPayloadSize());
pcm.ensureSize(NetPayloadSchema.class, 8, SSLUtil.MinTLSBlock); ///must be large enough for encrypt/decrypt
public ServerPipesConfig buildServerConfig() { pcmOut.ensureSize(ServerResponseSchema.class, 4, 512); int blocksFromSocket = 32; int queueIn = 2; //2-1024 int queueOut = 4; //4-256 return new ServerPipesConfig( logFile, isTLS(), getMaxConnectionBits(), this.tracks, getEncryptionUnitsPerTrack(), getConcurrentChannelsPerEncryptUnit(), getDecryptionUnitsPerTrack(), getConcurrentChannelsPerDecryptUnit(), //one message might be broken into this many parts blocksFromSocket, minMemoryInputPipe, getMaxRequestSize(), getMaxResponseSize(), queueIn, queueOut, pcmIn,pcmOut); }
HTTPServerConfigImpl r = ((HTTPServerConfigImpl) config); r.pcmOut.ensureSize(ServerResponseSchema.class, 4, r.getMaxResponseSize()); r.pcmIn.ensureSize(ReleaseSchema.class, 1<<16, 0);//for high volume r.pcmOut.ensureSize(ReleaseSchema.class, 1<<16, 0);//for high volume