/** * Gets the unique ID for the next operator in the graph. The ID is of the following format: * jobName-jobId-opCode-nextOpNum; * * @param opCode the {@link OpCode} of the next operator * @return the unique ID for the next operator in the graph */ public String getNextOpId(OpCode opCode) { return getNextOpId(opCode, null); }
KV<Serde, Serde> getTableSerdes(String tableId) { //TODO: SAMZA-1893: should test whether the table is used in the current JobNode return appDesc.getTableSerdes(tableId); }
JobPlanner(ApplicationDescriptorImpl<? extends ApplicationDescriptor> descriptor) { this.appDesc = descriptor; this.userConfig = descriptor.getConfig(); }
@Test(expected = NullPointerException.class) public void testGetIntermediateStreamWithNoSerde() { Config mockConfig = getConfig(); String streamId = "streamId"; StreamApplicationDescriptorImpl streamAppDesc = new StreamApplicationDescriptorImpl(appDesc -> { }, mockConfig); IntermediateMessageStreamImpl<TestMessageEnvelope> intermediateStreamImpl = streamAppDesc.getIntermediateStream(streamId, null, false); // should throw }
@Test(expected = IllegalArgumentException.class) public void testGetInputStreamWithNullSerde() { GenericSystemDescriptor sd = new GenericSystemDescriptor("mockSystem", "mockSystemFactoryClass"); GenericInputDescriptor isd = sd.getInputDescriptor("mockStreamId", null); new StreamApplicationDescriptorImpl(appDesc -> { appDesc.getInputStream(isd); }, getConfig()); }
@Test(expected = IllegalStateException.class) public void testSetDefaultSystemDescriptorAfterGettingInputStream() { String streamId = "test-stream-1"; GenericSystemDescriptor sd = new GenericSystemDescriptor("mockSystem", "mockSystemFactoryClass"); GenericInputDescriptor isd = sd.getInputDescriptor(streamId, mock(Serde.class)); new StreamApplicationDescriptorImpl(appDesc -> { appDesc.getInputStream(isd); appDesc.withDefaultSystem(sd); // should throw exception }, getConfig()); }
@Test(expected = IllegalArgumentException.class) public void testGetOutputStreamWithNullSerde() { String streamId = "test-stream-1"; GenericSystemDescriptor sd = new GenericSystemDescriptor("mockSystem", "mockSystemFactoryClass"); GenericOutputDescriptor osd = sd.getOutputDescriptor(streamId, null); new StreamApplicationDescriptorImpl(appDesc -> { appDesc.getOutputStream(osd); }, getConfig()); }
@Test public void testProcessorLifecycleListenerFactory() { ProcessorLifecycleListenerFactory mockFactory = mock(ProcessorLifecycleListenerFactory.class); StreamApplication testApp = appSpec -> appSpec.withProcessorLifecycleListenerFactory(mockFactory); StreamApplicationDescriptorImpl appDesc = new StreamApplicationDescriptorImpl(testApp, getConfig()); assertEquals(appDesc.getProcessorLifecycleListenerFactory(), mockFactory); }
public ExampleExpandingSystemDescriptor(String systemName) { super(systemName, FACTORY_CLASS_NAME, (InputTransformer<String>) IncomingMessageEnvelope::toString, (streamGraph, inputDescriptor) -> (MessageStream<Long>) streamGraph.getInputStream(inputDescriptor) ); }
@Override public MockInputDescriptor<Integer> getInputDescriptor(String streamId, Serde serde) { return new MockInputDescriptor<>(streamId, this, serde); } }
@Test(expected = IllegalStateException.class) public void testGetSameInputStreamTwice() { String streamId = "test-stream-1"; GenericSystemDescriptor sd = new GenericSystemDescriptor("mockSystem", "mockSystemFactoryClass"); GenericInputDescriptor isd1 = sd.getInputDescriptor(streamId, mock(Serde.class)); GenericInputDescriptor isd2 = sd.getInputDescriptor(streamId, mock(Serde.class)); new StreamApplicationDescriptorImpl(appDesc -> { appDesc.getInputStream(isd1); // should throw exception appDesc.getInputStream(isd2); }, getConfig()); }
/** * Gets the unique ID for the next operator in the graph. The ID is of the following format: * jobName-jobId-opCode-nextOpNum; * * @param opCode the {@link OpCode} of the next operator * @return the unique ID for the next operator in the graph */ public String getNextOpId(OpCode opCode) { return getNextOpId(opCode, null); }
KV<Serde, Serde> getTableSerdes(String tableId) { //TODO: SAMZA-1893: should test whether the table is used in the current JobNode return appDesc.getTableSerdes(tableId); }
JobPlanner(ApplicationDescriptorImpl<? extends ApplicationDescriptor> descriptor) { this.appDesc = descriptor; this.userConfig = descriptor.getConfig(); }
@Override public MockInputDescriptor<Integer> getInputDescriptor(String streamId, Serde serde) { return new MockInputDescriptor<>(streamId, this, serde); } }
/** * Gets the unique ID for the next operator in the graph. The ID is of the following format: * jobName-jobId-opCode-nextOpNum; * * @param opCode the {@link OpCode} of the next operator * @return the unique ID for the next operator in the graph */ public String getNextOpId(OpCode opCode) { return getNextOpId(opCode, null); }
KV<Serde, Serde> getTableSerdes(String tableId) { //TODO: SAMZA-1893: should test whether the table is used in the current JobNode return appDesc.getTableSerdes(tableId); }
JobPlanner(ApplicationDescriptorImpl<? extends ApplicationDescriptor> descriptor) { this.appDesc = descriptor; this.userConfig = descriptor.getConfig(); }
/** * Gets the unique ID for the next operator in the graph. The ID is of the following format: * jobName-jobId-opCode-nextOpNum; * * @param opCode the {@link OpCode} of the next operator * @return the unique ID for the next operator in the graph */ public String getNextOpId(OpCode opCode) { return getNextOpId(opCode, null); }
/** * Gets the unique ID for the next operator in the graph. The ID is of the following format: * jobName-jobId-opCode-nextOpNum; * * @param opCode the {@link OpCode} of the next operator * @return the unique ID for the next operator in the graph */ public String getNextOpId(OpCode opCode) { return getNextOpId(opCode, null); }