target stringlengths 20 113k | src_fm stringlengths 11 86.3k | src_fm_fc stringlengths 21 86.4k | src_fm_fc_co stringlengths 30 86.4k | src_fm_fc_ms stringlengths 42 86.8k | src_fm_fc_ms_ff stringlengths 43 86.8k |
|---|---|---|---|---|---|
@Test public void deserializeArpWithTwoVlanTest() throws PacketParsingException { short innerVlan = 1234; short outerVlan = 2345; Ethernet ethernet = buildEthernet(srcAndDstMacAddresses, ethTypeToByteArray(EthType.VLAN_FRAME), shortToByteArray(outerVlan), ethTypeToByteArray(EthType.VLAN_FRAME), shortToByteArray(innerVl... | @VisibleForTesting ArpPacketData deserializeArp(Ethernet eth, SwitchId switchId, long cookie) { try { List<Integer> vlans = new ArrayList<>(); IPacket payload = EthernetPacketToolbox.extractPayload(eth, vlans); if (payload instanceof ARP) { return new ArpPacketData((ARP) payload, vlans); } } catch (Exception exception)... | ConnectedDevicesService implements IService, IInputTranslator { @VisibleForTesting ArpPacketData deserializeArp(Ethernet eth, SwitchId switchId, long cookie) { try { List<Integer> vlans = new ArrayList<>(); IPacket payload = EthernetPacketToolbox.extractPayload(eth, vlans); if (payload instanceof ARP) { return new ArpP... | ConnectedDevicesService implements IService, IInputTranslator { @VisibleForTesting ArpPacketData deserializeArp(Ethernet eth, SwitchId switchId, long cookie) { try { List<Integer> vlans = new ArrayList<>(); IPacket payload = EthernetPacketToolbox.extractPayload(eth, vlans); if (payload instanceof ARP) { return new ArpP... | ConnectedDevicesService implements IService, IInputTranslator { @VisibleForTesting ArpPacketData deserializeArp(Ethernet eth, SwitchId switchId, long cookie) { try { List<Integer> vlans = new ArrayList<>(); IPacket payload = EthernetPacketToolbox.extractPayload(eth, vlans); if (payload instanceof ARP) { return new ArpP... | ConnectedDevicesService implements IService, IInputTranslator { @VisibleForTesting ArpPacketData deserializeArp(Ethernet eth, SwitchId switchId, long cookie) { try { List<Integer> vlans = new ArrayList<>(); IPacket payload = EthernetPacketToolbox.extractPayload(eth, vlans); if (payload instanceof ARP) { return new ArpP... |
@Test public void deserializeArpWithQinQVlansTest() throws PacketParsingException { short vlan1 = 1234; short vlan2 = 2345; short vlan3 = 4000; Ethernet ethernet = buildEthernet(srcAndDstMacAddresses, ethTypeToByteArray(EthType.Q_IN_Q), shortToByteArray(vlan1), ethTypeToByteArray(EthType.BRIDGING), shortToByteArray(vla... | @VisibleForTesting ArpPacketData deserializeArp(Ethernet eth, SwitchId switchId, long cookie) { try { List<Integer> vlans = new ArrayList<>(); IPacket payload = EthernetPacketToolbox.extractPayload(eth, vlans); if (payload instanceof ARP) { return new ArpPacketData((ARP) payload, vlans); } } catch (Exception exception)... | ConnectedDevicesService implements IService, IInputTranslator { @VisibleForTesting ArpPacketData deserializeArp(Ethernet eth, SwitchId switchId, long cookie) { try { List<Integer> vlans = new ArrayList<>(); IPacket payload = EthernetPacketToolbox.extractPayload(eth, vlans); if (payload instanceof ARP) { return new ArpP... | ConnectedDevicesService implements IService, IInputTranslator { @VisibleForTesting ArpPacketData deserializeArp(Ethernet eth, SwitchId switchId, long cookie) { try { List<Integer> vlans = new ArrayList<>(); IPacket payload = EthernetPacketToolbox.extractPayload(eth, vlans); if (payload instanceof ARP) { return new ArpP... | ConnectedDevicesService implements IService, IInputTranslator { @VisibleForTesting ArpPacketData deserializeArp(Ethernet eth, SwitchId switchId, long cookie) { try { List<Integer> vlans = new ArrayList<>(); IPacket payload = EthernetPacketToolbox.extractPayload(eth, vlans); if (payload instanceof ARP) { return new ArpP... | ConnectedDevicesService implements IService, IInputTranslator { @VisibleForTesting ArpPacketData deserializeArp(Ethernet eth, SwitchId switchId, long cookie) { try { List<Integer> vlans = new ArrayList<>(); IPacket payload = EthernetPacketToolbox.extractPayload(eth, vlans); if (payload instanceof ARP) { return new ArpP... |
@Test public void shouldCreateConfigFromContextParameters() { FloodlightModuleContext context = new FloodlightModuleContext(); IFloodlightModule module = niceMock(IFloodlightModule.class); context.addConfigParam(module, "bootstrap-servers", TEST_BOOTSTRAP_SERVERS); FloodlightModuleConfigurationProvider provider = Flood... | public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider = new FloodlightModuleConfigurationProvider(configData); dumpConfigData(module.... | FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider... | FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider... | FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider... | FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider... |
@Test public void shouldCreateEnvConfigFromContextParameters() { FloodlightModuleContext context = new FloodlightModuleContext(); IFloodlightModule module = niceMock(IFloodlightModule.class); context.addConfigParam(module, "environment-naming-prefix", TEST_PREFIX); FloodlightModuleConfigurationProvider provider = Flood... | public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider = new FloodlightModuleConfigurationProvider(configData); dumpConfigData(module.... | FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider... | FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider... | FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider... | FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider... |
@Test public void shouldCreateConfigWithEnvPrefix() { FloodlightModuleContext context = new FloodlightModuleContext(); IFloodlightModule module = niceMock(IFloodlightModule.class); context.addConfigParam(module, "environment-naming-prefix", TEST_PREFIX); FloodlightModuleConfigurationProvider provider = FloodlightModule... | public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider = new FloodlightModuleConfigurationProvider(configData); dumpConfigData(module.... | FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider... | FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider... | FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider... | FloodlightModuleConfigurationProvider extends ValidatingConfigurationProvider { public static FloodlightModuleConfigurationProvider of(FloodlightModuleContext moduleContext, IFloodlightModule module) { Map<String, String> configData = moduleContext.getConfigParams(module); FloodlightModuleConfigurationProvider provider... |
@Test public void success() throws Exception { final PingService realPingService = new PingService(); moduleContext.addService(PingService.class, realPingService); final ISwitchManager realSwitchManager = new SwitchManager(); moduleContext.addService(ISwitchManager.class, realSwitchManager); InputService inputService =... | @Override public Command call() { log.debug("{} - {}", getClass().getCanonicalName(), input); byte[] payload = unwrap(); if (payload == null) { return null; } log.info("Receive flow ping packet from switch {} OF-xid:{}", input.getDpId(), input.getMessage().getXid()); try { PingData pingData = decode(payload); getContex... | PingResponseCommand extends PingCommand { @Override public Command call() { log.debug("{} - {}", getClass().getCanonicalName(), input); byte[] payload = unwrap(); if (payload == null) { return null; } log.info("Receive flow ping packet from switch {} OF-xid:{}", input.getDpId(), input.getMessage().getXid()); try { Ping... | PingResponseCommand extends PingCommand { @Override public Command call() { log.debug("{} - {}", getClass().getCanonicalName(), input); byte[] payload = unwrap(); if (payload == null) { return null; } log.info("Receive flow ping packet from switch {} OF-xid:{}", input.getDpId(), input.getMessage().getXid()); try { Ping... | PingResponseCommand extends PingCommand { @Override public Command call() { log.debug("{} - {}", getClass().getCanonicalName(), input); byte[] payload = unwrap(); if (payload == null) { return null; } log.info("Receive flow ping packet from switch {} OF-xid:{}", input.getDpId(), input.getMessage().getXid()); try { Ping... | PingResponseCommand extends PingCommand { @Override public Command call() { log.debug("{} - {}", getClass().getCanonicalName(), input); byte[] payload = unwrap(); if (payload == null) { return null; } log.info("Receive flow ping packet from switch {} OF-xid:{}", input.getDpId(), input.getMessage().getXid()); try { Ping... |
@Test public void makeOuterVlanMatchSharedMessage() { final IngressFlowModFactory factory = makeFactory(); final IngressFlowSegmentBase command = factory.getCommand(); final FlowEndpoint endpoint = command.getEndpoint(); RoutingMetadata metadata = RoutingMetadata.builder() .outerVlanId(endpoint.getOuterVlanId()) .build... | public OFFlowMod makeOuterVlanMatchSharedMessage() { FlowEndpoint endpoint = command.getEndpoint(); FlowSharedSegmentCookie cookie = FlowSharedSegmentCookie.builder(SharedSegmentType.QINQ_OUTER_VLAN) .portNumber(endpoint.getPortNumber()) .vlanId(endpoint.getOuterVlanId()) .build(); return flowModBuilderFactory.makeBuil... | IngressFlowModFactory { public OFFlowMod makeOuterVlanMatchSharedMessage() { FlowEndpoint endpoint = command.getEndpoint(); FlowSharedSegmentCookie cookie = FlowSharedSegmentCookie.builder(SharedSegmentType.QINQ_OUTER_VLAN) .portNumber(endpoint.getPortNumber()) .vlanId(endpoint.getOuterVlanId()) .build(); return flowMo... | IngressFlowModFactory { public OFFlowMod makeOuterVlanMatchSharedMessage() { FlowEndpoint endpoint = command.getEndpoint(); FlowSharedSegmentCookie cookie = FlowSharedSegmentCookie.builder(SharedSegmentType.QINQ_OUTER_VLAN) .portNumber(endpoint.getPortNumber()) .vlanId(endpoint.getOuterVlanId()) .build(); return flowMo... | IngressFlowModFactory { public OFFlowMod makeOuterVlanMatchSharedMessage() { FlowEndpoint endpoint = command.getEndpoint(); FlowSharedSegmentCookie cookie = FlowSharedSegmentCookie.builder(SharedSegmentType.QINQ_OUTER_VLAN) .portNumber(endpoint.getPortNumber()) .vlanId(endpoint.getOuterVlanId()) .build(); return flowMo... | IngressFlowModFactory { public OFFlowMod makeOuterVlanMatchSharedMessage() { FlowEndpoint endpoint = command.getEndpoint(); FlowSharedSegmentCookie cookie = FlowSharedSegmentCookie.builder(SharedSegmentType.QINQ_OUTER_VLAN) .portNumber(endpoint.getPortNumber()) .vlanId(endpoint.getOuterVlanId()) .build(); return flowMo... |
@Test public void makeCustomerPortSharedCatchInstallMessage() { IngressFlowModFactory factory = makeFactory(); FlowEndpoint endpoint = factory.getCommand().getEndpoint(); OFFlowMod expected = of.buildFlowAdd() .setTableId(TableId.of(SwitchManager.INPUT_TABLE_ID)) .setPriority(SwitchManager.INGRESS_CUSTOMER_PORT_RULE_PR... | public OFFlowMod makeCustomerPortSharedCatchMessage() { FlowEndpoint endpoint = command.getEndpoint(); return flowModBuilderFactory.makeBuilder(of, TableId.of(SwitchManager.INPUT_TABLE_ID)) .setPriority(SwitchManager.INGRESS_CUSTOMER_PORT_RULE_PRIORITY_MULTITABLE) .setCookie(U64.of(Cookie.encodeIngressRulePassThrough(e... | IngressFlowModFactory { public OFFlowMod makeCustomerPortSharedCatchMessage() { FlowEndpoint endpoint = command.getEndpoint(); return flowModBuilderFactory.makeBuilder(of, TableId.of(SwitchManager.INPUT_TABLE_ID)) .setPriority(SwitchManager.INGRESS_CUSTOMER_PORT_RULE_PRIORITY_MULTITABLE) .setCookie(U64.of(Cookie.encode... | IngressFlowModFactory { public OFFlowMod makeCustomerPortSharedCatchMessage() { FlowEndpoint endpoint = command.getEndpoint(); return flowModBuilderFactory.makeBuilder(of, TableId.of(SwitchManager.INPUT_TABLE_ID)) .setPriority(SwitchManager.INGRESS_CUSTOMER_PORT_RULE_PRIORITY_MULTITABLE) .setCookie(U64.of(Cookie.encode... | IngressFlowModFactory { public OFFlowMod makeCustomerPortSharedCatchMessage() { FlowEndpoint endpoint = command.getEndpoint(); return flowModBuilderFactory.makeBuilder(of, TableId.of(SwitchManager.INPUT_TABLE_ID)) .setPriority(SwitchManager.INGRESS_CUSTOMER_PORT_RULE_PRIORITY_MULTITABLE) .setCookie(U64.of(Cookie.encode... | IngressFlowModFactory { public OFFlowMod makeCustomerPortSharedCatchMessage() { FlowEndpoint endpoint = command.getEndpoint(); return flowModBuilderFactory.makeBuilder(of, TableId.of(SwitchManager.INPUT_TABLE_ID)) .setPriority(SwitchManager.INGRESS_CUSTOMER_PORT_RULE_PRIORITY_MULTITABLE) .setCookie(U64.of(Cookie.encode... |
@Test public void extractEthernetPayloadTest() { short vlan1 = 1234; short vlan2 = 2345; short vlan3 = 4000; byte[] originPayload = new byte[]{0x55, (byte) 0xAA}; Ethernet ethernet = buildEthernet( new byte[]{ 0x01, 0x0A, 0x0A, 0x0A, 0x0A, 0x0A, 0x01, 0x0B, 0x0B, 0x0B, 0x0B, 0x0B }, ethTypeToByteArray(EthType.Q_IN_Q), ... | public static IPacket extractPayload(Ethernet packet, List<Integer> vlanStack) { short rootVlan = packet.getVlanID(); if (0 < rootVlan) { vlanStack.add((int) rootVlan); } IPacket payload = packet.getPayload(); while (payload instanceof VlanTag) { short vlanId = ((VlanTag) payload).getVlanId(); vlanStack.add((int) vlanI... | EthernetPacketToolbox { public static IPacket extractPayload(Ethernet packet, List<Integer> vlanStack) { short rootVlan = packet.getVlanID(); if (0 < rootVlan) { vlanStack.add((int) rootVlan); } IPacket payload = packet.getPayload(); while (payload instanceof VlanTag) { short vlanId = ((VlanTag) payload).getVlanId(); v... | EthernetPacketToolbox { public static IPacket extractPayload(Ethernet packet, List<Integer> vlanStack) { short rootVlan = packet.getVlanID(); if (0 < rootVlan) { vlanStack.add((int) rootVlan); } IPacket payload = packet.getPayload(); while (payload instanceof VlanTag) { short vlanId = ((VlanTag) payload).getVlanId(); v... | EthernetPacketToolbox { public static IPacket extractPayload(Ethernet packet, List<Integer> vlanStack) { short rootVlan = packet.getVlanID(); if (0 < rootVlan) { vlanStack.add((int) rootVlan); } IPacket payload = packet.getPayload(); while (payload instanceof VlanTag) { short vlanId = ((VlanTag) payload).getVlanId(); v... | EthernetPacketToolbox { public static IPacket extractPayload(Ethernet packet, List<Integer> vlanStack) { short rootVlan = packet.getVlanID(); if (0 < rootVlan) { vlanStack.add((int) rootVlan); } IPacket payload = packet.getPayload(); while (payload instanceof VlanTag) { short vlanId = ((VlanTag) payload).getVlanId(); v... |
@Test(expected = IllegalSwitchPropertiesException.class) public void shouldValidateFlowWithArpFlagWhenUpdatingSwitchProperties() { Switch firstSwitch = Switch.builder().switchId(TEST_SWITCH_ID).status(SwitchStatus.ACTIVE).build(); Switch secondSwitch = Switch.builder().switchId(TEST_SWITCH_ID_2).status(SwitchStatus.ACT... | public SwitchPropertiesDto updateSwitchProperties(SwitchId switchId, SwitchPropertiesDto switchPropertiesDto) { if (isEmpty(switchPropertiesDto.getSupportedTransitEncapsulation())) { throw new IllegalSwitchPropertiesException("Supported transit encapsulations should not be null or empty"); } SwitchProperties update = S... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public SwitchPropertiesDto updateSwitchProperties(SwitchId switchId, SwitchPropertiesDto switchPropertiesDto) { if (isEmpty(switchPropertiesDto.getSupportedTransitEncapsulation())) { throw new IllegalSwitchPropertiesException("Supported transit encapsul... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public SwitchPropertiesDto updateSwitchProperties(SwitchId switchId, SwitchPropertiesDto switchPropertiesDto) { if (isEmpty(switchPropertiesDto.getSupportedTransitEncapsulation())) { throw new IllegalSwitchPropertiesException("Supported transit encapsul... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public SwitchPropertiesDto updateSwitchProperties(SwitchId switchId, SwitchPropertiesDto switchPropertiesDto) { if (isEmpty(switchPropertiesDto.getSupportedTransitEncapsulation())) { throw new IllegalSwitchPropertiesException("Supported transit encapsul... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public SwitchPropertiesDto updateSwitchProperties(SwitchId switchId, SwitchPropertiesDto switchPropertiesDto) { if (isEmpty(switchPropertiesDto.getSupportedTransitEncapsulation())) { throw new IllegalSwitchPropertiesException("Supported transit encapsul... |
@Test public void inaccurateSetFieldVlanVidActionNegative() { OfFlowPresenceVerifier presenceVerifier = testInaccurateSetFieldVlanVidAction(Collections.emptySet()); Assert.assertFalse(presenceVerifier.getMissing().isEmpty()); } | public List<OFFlowMod> getMissing() { return expectedOfFlows.values().stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } | OfFlowPresenceVerifier { public List<OFFlowMod> getMissing() { return expectedOfFlows.values().stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } } | OfFlowPresenceVerifier { public List<OFFlowMod> getMissing() { return expectedOfFlows.values().stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } OfFlowPresenceVerifier(
IOfFlowDumpProducer dumpProducer, List<OFFlowMod> expectedFlows, Set<SwitchFeature> switchFeatures); } | OfFlowPresenceVerifier { public List<OFFlowMod> getMissing() { return expectedOfFlows.values().stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } OfFlowPresenceVerifier(
IOfFlowDumpProducer dumpProducer, List<OFFlowMod> expectedFlows, Set<SwitchFeature> switchFeatures); List<OFFlowMod> g... | OfFlowPresenceVerifier { public List<OFFlowMod> getMissing() { return expectedOfFlows.values().stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } OfFlowPresenceVerifier(
IOfFlowDumpProducer dumpProducer, List<OFFlowMod> expectedFlows, Set<SwitchFeature> switchFeatures); List<OFFlowMod> g... |
@Test public void inaccurateSetFieldVlanVidActionPositive() { OfFlowPresenceVerifier presenceVerifier = testInaccurateSetFieldVlanVidAction(Collections.singleton( SwitchFeature.INACCURATE_SET_VLAN_VID_ACTION)); Assert.assertTrue(presenceVerifier.getMissing().isEmpty()); } | public List<OFFlowMod> getMissing() { return expectedOfFlows.values().stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } | OfFlowPresenceVerifier { public List<OFFlowMod> getMissing() { return expectedOfFlows.values().stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } } | OfFlowPresenceVerifier { public List<OFFlowMod> getMissing() { return expectedOfFlows.values().stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } OfFlowPresenceVerifier(
IOfFlowDumpProducer dumpProducer, List<OFFlowMod> expectedFlows, Set<SwitchFeature> switchFeatures); } | OfFlowPresenceVerifier { public List<OFFlowMod> getMissing() { return expectedOfFlows.values().stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } OfFlowPresenceVerifier(
IOfFlowDumpProducer dumpProducer, List<OFFlowMod> expectedFlows, Set<SwitchFeature> switchFeatures); List<OFFlowMod> g... | OfFlowPresenceVerifier { public List<OFFlowMod> getMissing() { return expectedOfFlows.values().stream() .flatMap(Collection::stream) .collect(Collectors.toList()); } OfFlowPresenceVerifier(
IOfFlowDumpProducer dumpProducer, List<OFFlowMod> expectedFlows, Set<SwitchFeature> switchFeatures); List<OFFlowMod> g... |
@Ignore("Fix applying aspects to test classes") @Test @NewCorrelationContextRequired public void shouldInitializeCorrelationId() { String correlationId = CorrelationContext.getId(); assertNotEquals(DEFAULT_CORRELATION_ID, correlationId); } | public static String getId() { return Optional.ofNullable(ID.get()).orElse(DEFAULT_CORRELATION_ID); } | CorrelationContext { public static String getId() { return Optional.ofNullable(ID.get()).orElse(DEFAULT_CORRELATION_ID); } } | CorrelationContext { public static String getId() { return Optional.ofNullable(ID.get()).orElse(DEFAULT_CORRELATION_ID); } private CorrelationContext(); } | CorrelationContext { public static String getId() { return Optional.ofNullable(ID.get()).orElse(DEFAULT_CORRELATION_ID); } private CorrelationContext(); static String getId(); static CorrelationContextClosable create(String correlationId); } | CorrelationContext { public static String getId() { return Optional.ofNullable(ID.get()).orElse(DEFAULT_CORRELATION_ID); } private CorrelationContext(); static String getId(); static CorrelationContextClosable create(String correlationId); } |
@Test public void testIsNoviSwitch() { assertTrue(isNoviSwitch(makeSwitchMock("NoviFlow Inc", "NW400.4.0", "NS21100"))); assertTrue(isNoviSwitch(makeSwitchMock("NoviFlow Inc", "NW500.2.0_dev", "NS21100"))); assertTrue(isNoviSwitch(makeSwitchMock("NoviFlow Inc", "NW500.0.1", "WB5164-E"))); assertTrue(isNoviSwitch(makeSw... | static boolean isNoviSwitch(IOFSwitch sw) { if (sw == null || sw.getSwitchDescription() == null) { return false; } String manufacturer = getManufacturer(sw); if (E_SWITCH_MANUFACTURER_DESCRIPTION.equalsIgnoreCase(manufacturer)) { return true; } SwitchDescription description = sw.getSwitchDescription(); if (E_SWITCH_HAR... | NoviflowSpecificFeature extends AbstractFeature { static boolean isNoviSwitch(IOFSwitch sw) { if (sw == null || sw.getSwitchDescription() == null) { return false; } String manufacturer = getManufacturer(sw); if (E_SWITCH_MANUFACTURER_DESCRIPTION.equalsIgnoreCase(manufacturer)) { return true; } SwitchDescription descrip... | NoviflowSpecificFeature extends AbstractFeature { static boolean isNoviSwitch(IOFSwitch sw) { if (sw == null || sw.getSwitchDescription() == null) { return false; } String manufacturer = getManufacturer(sw); if (E_SWITCH_MANUFACTURER_DESCRIPTION.equalsIgnoreCase(manufacturer)) { return true; } SwitchDescription descrip... | NoviflowSpecificFeature extends AbstractFeature { static boolean isNoviSwitch(IOFSwitch sw) { if (sw == null || sw.getSwitchDescription() == null) { return false; } String manufacturer = getManufacturer(sw); if (E_SWITCH_MANUFACTURER_DESCRIPTION.equalsIgnoreCase(manufacturer)) { return true; } SwitchDescription descrip... | NoviflowSpecificFeature extends AbstractFeature { static boolean isNoviSwitch(IOFSwitch sw) { if (sw == null || sw.getSwitchDescription() == null) { return false; } String manufacturer = getManufacturer(sw); if (E_SWITCH_MANUFACTURER_DESCRIPTION.equalsIgnoreCase(manufacturer)) { return true; } SwitchDescription descrip... |
@Test public void testIsWbSeries() { assertTrue(isWbSeries(makeSwitchMock("NoviFlow Inc", "NW500.0.1", "WB5164-E"))); assertTrue(isWbSeries(makeSwitchMock("E", "NW400.4.0", "WB5164"))); assertFalse(isWbSeries(makeSwitchMock("NoviFlow Inc", "NW400.4.0", "NS21100"))); assertFalse(isWbSeries(makeSwitchMock("NoviFlow Inc",... | static boolean isWbSeries(IOFSwitch sw) { if (! isNoviSwitch(sw)) { return false; } if (E_SWITCH_MANUFACTURER_DESCRIPTION.equalsIgnoreCase(getManufacturer(sw))) { return true; } Optional<SwitchDescription> description = Optional.ofNullable(sw.getSwitchDescription()); return E_SWITCH_HARDWARE_DESCRIPTION_REGEX.matcher( ... | NoviflowSpecificFeature extends AbstractFeature { static boolean isWbSeries(IOFSwitch sw) { if (! isNoviSwitch(sw)) { return false; } if (E_SWITCH_MANUFACTURER_DESCRIPTION.equalsIgnoreCase(getManufacturer(sw))) { return true; } Optional<SwitchDescription> description = Optional.ofNullable(sw.getSwitchDescription()); re... | NoviflowSpecificFeature extends AbstractFeature { static boolean isWbSeries(IOFSwitch sw) { if (! isNoviSwitch(sw)) { return false; } if (E_SWITCH_MANUFACTURER_DESCRIPTION.equalsIgnoreCase(getManufacturer(sw))) { return true; } Optional<SwitchDescription> description = Optional.ofNullable(sw.getSwitchDescription()); re... | NoviflowSpecificFeature extends AbstractFeature { static boolean isWbSeries(IOFSwitch sw) { if (! isNoviSwitch(sw)) { return false; } if (E_SWITCH_MANUFACTURER_DESCRIPTION.equalsIgnoreCase(getManufacturer(sw))) { return true; } Optional<SwitchDescription> description = Optional.ofNullable(sw.getSwitchDescription()); re... | NoviflowSpecificFeature extends AbstractFeature { static boolean isWbSeries(IOFSwitch sw) { if (! isNoviSwitch(sw)) { return false; } if (E_SWITCH_MANUFACTURER_DESCRIPTION.equalsIgnoreCase(getManufacturer(sw))) { return true; } Optional<SwitchDescription> description = Optional.ofNullable(sw.getSwitchDescription()); re... |
@Test public void testIsSmSeries() { assertTrue(isSmSeries(makeSwitchMock("NoviFlow Inc", "NW500.0.1", "SM5000-SM"))); assertFalse(isSmSeries(makeSwitchMock("NoviFlow Inc", "NW500.0.1", "WB5164-E"))); assertFalse(isSmSeries(makeSwitchMock("E", "NW400.4.0", "WB5164"))); assertFalse(isSmSeries(makeSwitchMock("NoviFlow In... | static boolean isSmSeries(IOFSwitch sw) { if (! isNoviSwitch(sw)) { return false; } Optional<SwitchDescription> description = Optional.ofNullable(sw.getSwitchDescription()); return NOVIFLOW_VIRTUAL_SWITCH_HARDWARE_DESCRIPTION_REGEX.matcher( description.map(SwitchDescription::getHardwareDescription) .orElse("")).matches... | NoviflowSpecificFeature extends AbstractFeature { static boolean isSmSeries(IOFSwitch sw) { if (! isNoviSwitch(sw)) { return false; } Optional<SwitchDescription> description = Optional.ofNullable(sw.getSwitchDescription()); return NOVIFLOW_VIRTUAL_SWITCH_HARDWARE_DESCRIPTION_REGEX.matcher( description.map(SwitchDescrip... | NoviflowSpecificFeature extends AbstractFeature { static boolean isSmSeries(IOFSwitch sw) { if (! isNoviSwitch(sw)) { return false; } Optional<SwitchDescription> description = Optional.ofNullable(sw.getSwitchDescription()); return NOVIFLOW_VIRTUAL_SWITCH_HARDWARE_DESCRIPTION_REGEX.matcher( description.map(SwitchDescrip... | NoviflowSpecificFeature extends AbstractFeature { static boolean isSmSeries(IOFSwitch sw) { if (! isNoviSwitch(sw)) { return false; } Optional<SwitchDescription> description = Optional.ofNullable(sw.getSwitchDescription()); return NOVIFLOW_VIRTUAL_SWITCH_HARDWARE_DESCRIPTION_REGEX.matcher( description.map(SwitchDescrip... | NoviflowSpecificFeature extends AbstractFeature { static boolean isSmSeries(IOFSwitch sw) { if (! isNoviSwitch(sw)) { return false; } Optional<SwitchDescription> description = Optional.ofNullable(sw.getSwitchDescription()); return NOVIFLOW_VIRTUAL_SWITCH_HARDWARE_DESCRIPTION_REGEX.matcher( description.map(SwitchDescrip... |
@Test public void testDiscoverOfSwitchWithoutBfdSupport() { Assert.assertFalse(bfdFeature.discover(createSwitchWithDescription(null)).isPresent()); assertWithoutBfdSupport("2.8.16.21"); assertWithoutBfdSupport("2.8.16.15"); assertWithoutBfdSupport("8.1.0.14"); } | @Override public Optional<SwitchFeature> discover(IOFSwitch sw) { Optional<SwitchFeature> empty = Optional.empty(); SwitchDescription description = sw.getSwitchDescription(); if (description == null || description.getSoftwareDescription() == null) { return empty; } if (!NOVIFLOW_SOFTWARE_DESCRIPTION_REGEX.matcher(descr... | BfdFeature extends AbstractFeature { @Override public Optional<SwitchFeature> discover(IOFSwitch sw) { Optional<SwitchFeature> empty = Optional.empty(); SwitchDescription description = sw.getSwitchDescription(); if (description == null || description.getSoftwareDescription() == null) { return empty; } if (!NOVIFLOW_SOF... | BfdFeature extends AbstractFeature { @Override public Optional<SwitchFeature> discover(IOFSwitch sw) { Optional<SwitchFeature> empty = Optional.empty(); SwitchDescription description = sw.getSwitchDescription(); if (description == null || description.getSoftwareDescription() == null) { return empty; } if (!NOVIFLOW_SOF... | BfdFeature extends AbstractFeature { @Override public Optional<SwitchFeature> discover(IOFSwitch sw) { Optional<SwitchFeature> empty = Optional.empty(); SwitchDescription description = sw.getSwitchDescription(); if (description == null || description.getSoftwareDescription() == null) { return empty; } if (!NOVIFLOW_SOF... | BfdFeature extends AbstractFeature { @Override public Optional<SwitchFeature> discover(IOFSwitch sw) { Optional<SwitchFeature> empty = Optional.empty(); SwitchDescription description = sw.getSwitchDescription(); if (description == null || description.getSoftwareDescription() == null) { return empty; } if (!NOVIFLOW_SOF... |
@Test public void testToPortStatsDataV13() { OFFactoryVer13 ofFactoryVer13 = new OFFactoryVer13(); OFPortStatsEntry ofPortStatsEntry = prebuildPortStatsEntry(ofFactoryVer13.buildPortStatsEntry()) .setRxFrameErr(U64.of(rxFrameErr)) .setRxOverErr(U64.of(rxOverErr)) .setRxCrcErr(U64.of(rxCrcErr)) .setCollisions(U64.of(col... | public PortStatsData toPostStatsData(List<OFPortStatsReply> data, SwitchId switchId) { try { List<PortStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toPortStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new PortStatsData(switchId, stats); } catch (NullPointe... | OfPortStatsMapper { public PortStatsData toPostStatsData(List<OFPortStatsReply> data, SwitchId switchId) { try { List<PortStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toPortStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new PortStatsData(switchId, stats);... | OfPortStatsMapper { public PortStatsData toPostStatsData(List<OFPortStatsReply> data, SwitchId switchId) { try { List<PortStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toPortStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new PortStatsData(switchId, stats);... | OfPortStatsMapper { public PortStatsData toPostStatsData(List<OFPortStatsReply> data, SwitchId switchId) { try { List<PortStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toPortStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new PortStatsData(switchId, stats);... | OfPortStatsMapper { public PortStatsData toPostStatsData(List<OFPortStatsReply> data, SwitchId switchId) { try { List<PortStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toPortStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new PortStatsData(switchId, stats);... |
@Test public void testToPortStatsDataV14() { OFFactoryVer14 ofFactoryVer14 = new OFFactoryVer14(); OFPortStatsProp opticalProps = ofFactoryVer14.buildPortStatsPropOptical().setRxPwr(123).build(); OFPortStatsProp ethernetProps = ofFactoryVer14.buildPortStatsPropEthernet() .setRxFrameErr(U64.of(rxFrameErr)) .setRxOverErr... | public PortStatsData toPostStatsData(List<OFPortStatsReply> data, SwitchId switchId) { try { List<PortStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toPortStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new PortStatsData(switchId, stats); } catch (NullPointe... | OfPortStatsMapper { public PortStatsData toPostStatsData(List<OFPortStatsReply> data, SwitchId switchId) { try { List<PortStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toPortStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new PortStatsData(switchId, stats);... | OfPortStatsMapper { public PortStatsData toPostStatsData(List<OFPortStatsReply> data, SwitchId switchId) { try { List<PortStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toPortStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new PortStatsData(switchId, stats);... | OfPortStatsMapper { public PortStatsData toPostStatsData(List<OFPortStatsReply> data, SwitchId switchId) { try { List<PortStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toPortStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new PortStatsData(switchId, stats);... | OfPortStatsMapper { public PortStatsData toPostStatsData(List<OFPortStatsReply> data, SwitchId switchId) { try { List<PortStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toPortStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new PortStatsData(switchId, stats);... |
@Test public void testToFlowStatsData() { OFFlowStatsEntry ofEntry = buildFlowStatsEntry(); OFFlowStatsReply ofReply = factory.buildFlowStatsReply() .setXid(xId) .setEntries(Collections.singletonList(ofEntry)) .build(); FlowStatsData data = OfFlowStatsMapper.INSTANCE.toFlowStatsData(Collections.singletonList(ofReply), ... | public FlowStatsData toFlowStatsData(List<OFFlowStatsReply> data, SwitchId switchId) { try { List<FlowStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toFlowStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new FlowStatsData(switchId, stats); } catch (NullPointe... | OfFlowStatsMapper { public FlowStatsData toFlowStatsData(List<OFFlowStatsReply> data, SwitchId switchId) { try { List<FlowStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toFlowStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new FlowStatsData(switchId, stats);... | OfFlowStatsMapper { public FlowStatsData toFlowStatsData(List<OFFlowStatsReply> data, SwitchId switchId) { try { List<FlowStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toFlowStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new FlowStatsData(switchId, stats);... | OfFlowStatsMapper { public FlowStatsData toFlowStatsData(List<OFFlowStatsReply> data, SwitchId switchId) { try { List<FlowStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toFlowStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new FlowStatsData(switchId, stats);... | OfFlowStatsMapper { public FlowStatsData toFlowStatsData(List<OFFlowStatsReply> data, SwitchId switchId) { try { List<FlowStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toFlowStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new FlowStatsData(switchId, stats);... |
@Test public void shouldUpdateServer42SwitchProperties() { Switch sw = Switch.builder() .switchId(TEST_SWITCH_ID) .status(SwitchStatus.ACTIVE) .features(Collections.singleton(SwitchFeature.MULTI_TABLE)) .build(); switchRepository.add(sw); createServer42SwitchProperties(sw, false, SERVER_42_PORT_1, SERVER_42_VLAN_1, SER... | public SwitchPropertiesDto updateSwitchProperties(SwitchId switchId, SwitchPropertiesDto switchPropertiesDto) { if (isEmpty(switchPropertiesDto.getSupportedTransitEncapsulation())) { throw new IllegalSwitchPropertiesException("Supported transit encapsulations should not be null or empty"); } SwitchProperties update = S... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public SwitchPropertiesDto updateSwitchProperties(SwitchId switchId, SwitchPropertiesDto switchPropertiesDto) { if (isEmpty(switchPropertiesDto.getSupportedTransitEncapsulation())) { throw new IllegalSwitchPropertiesException("Supported transit encapsul... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public SwitchPropertiesDto updateSwitchProperties(SwitchId switchId, SwitchPropertiesDto switchPropertiesDto) { if (isEmpty(switchPropertiesDto.getSupportedTransitEncapsulation())) { throw new IllegalSwitchPropertiesException("Supported transit encapsul... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public SwitchPropertiesDto updateSwitchProperties(SwitchId switchId, SwitchPropertiesDto switchPropertiesDto) { if (isEmpty(switchPropertiesDto.getSupportedTransitEncapsulation())) { throw new IllegalSwitchPropertiesException("Supported transit encapsul... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public SwitchPropertiesDto updateSwitchProperties(SwitchId switchId, SwitchPropertiesDto switchPropertiesDto) { if (isEmpty(switchPropertiesDto.getSupportedTransitEncapsulation())) { throw new IllegalSwitchPropertiesException("Supported transit encapsul... |
@Test public void testFlowEntry() { OFFlowStatsEntry ofEntry = buildFlowStatsEntry(); FlowEntry entry = OfFlowStatsMapper.INSTANCE.toFlowEntry(ofEntry); assertEquals(tableId, entry.getTableId()); assertEquals(cookie, entry.getCookie()); assertEquals(packetCount, entry.getPacketCount()); assertEquals(byteCount, entry.ge... | public FlowEntry toFlowEntry(final OFFlowStatsEntry entry) { return FlowEntry.builder() .version(entry.getVersion().toString()) .durationSeconds(entry.getDurationSec()) .durationNanoSeconds(entry.getDurationNsec()) .hardTimeout(entry.getHardTimeout()) .idleTimeout(entry.getIdleTimeout()) .priority(entry.getPriority()) ... | OfFlowStatsMapper { public FlowEntry toFlowEntry(final OFFlowStatsEntry entry) { return FlowEntry.builder() .version(entry.getVersion().toString()) .durationSeconds(entry.getDurationSec()) .durationNanoSeconds(entry.getDurationNsec()) .hardTimeout(entry.getHardTimeout()) .idleTimeout(entry.getIdleTimeout()) .priority(e... | OfFlowStatsMapper { public FlowEntry toFlowEntry(final OFFlowStatsEntry entry) { return FlowEntry.builder() .version(entry.getVersion().toString()) .durationSeconds(entry.getDurationSec()) .durationNanoSeconds(entry.getDurationNsec()) .hardTimeout(entry.getHardTimeout()) .idleTimeout(entry.getIdleTimeout()) .priority(e... | OfFlowStatsMapper { public FlowEntry toFlowEntry(final OFFlowStatsEntry entry) { return FlowEntry.builder() .version(entry.getVersion().toString()) .durationSeconds(entry.getDurationSec()) .durationNanoSeconds(entry.getDurationNsec()) .hardTimeout(entry.getHardTimeout()) .idleTimeout(entry.getIdleTimeout()) .priority(e... | OfFlowStatsMapper { public FlowEntry toFlowEntry(final OFFlowStatsEntry entry) { return FlowEntry.builder() .version(entry.getVersion().toString()) .durationSeconds(entry.getDurationSec()) .durationNanoSeconds(entry.getDurationNsec()) .hardTimeout(entry.getHardTimeout()) .idleTimeout(entry.getIdleTimeout()) .priority(e... |
@Test public void testFlowGroupEntry() { OFGroupDescStatsEntry entry = buildFlowGroupEntry(); GroupEntry result = OfFlowStatsMapper.INSTANCE.toFlowGroupEntry(entry); assertEquals(entry.getGroup().getGroupNumber(), result.getGroupId()); assertEquals(entry.getGroupType().toString(), result.getGroupType()); assertEquals(e... | public GroupEntry toFlowGroupEntry(OFGroupDescStatsEntry ofGroupDescStatsEntry) { if (ofGroupDescStatsEntry == null) { return null; } return GroupEntry.builder() .groupType(ofGroupDescStatsEntry.getGroupType().toString()) .groupId(ofGroupDescStatsEntry.getGroup().getGroupNumber()) .buckets(ofGroupDescStatsEntry.getBuck... | OfFlowStatsMapper { public GroupEntry toFlowGroupEntry(OFGroupDescStatsEntry ofGroupDescStatsEntry) { if (ofGroupDescStatsEntry == null) { return null; } return GroupEntry.builder() .groupType(ofGroupDescStatsEntry.getGroupType().toString()) .groupId(ofGroupDescStatsEntry.getGroup().getGroupNumber()) .buckets(ofGroupDe... | OfFlowStatsMapper { public GroupEntry toFlowGroupEntry(OFGroupDescStatsEntry ofGroupDescStatsEntry) { if (ofGroupDescStatsEntry == null) { return null; } return GroupEntry.builder() .groupType(ofGroupDescStatsEntry.getGroupType().toString()) .groupId(ofGroupDescStatsEntry.getGroup().getGroupNumber()) .buckets(ofGroupDe... | OfFlowStatsMapper { public GroupEntry toFlowGroupEntry(OFGroupDescStatsEntry ofGroupDescStatsEntry) { if (ofGroupDescStatsEntry == null) { return null; } return GroupEntry.builder() .groupType(ofGroupDescStatsEntry.getGroupType().toString()) .groupId(ofGroupDescStatsEntry.getGroup().getGroupNumber()) .buckets(ofGroupDe... | OfFlowStatsMapper { public GroupEntry toFlowGroupEntry(OFGroupDescStatsEntry ofGroupDescStatsEntry) { if (ofGroupDescStatsEntry == null) { return null; } return GroupEntry.builder() .groupType(ofGroupDescStatsEntry.getGroupType().toString()) .groupId(ofGroupDescStatsEntry.getGroup().getGroupNumber()) .buckets(ofGroupDe... |
@Test public void shouldConvertSuccessfully() { OFFactoryVer13 ofFactoryVer13 = new OFFactoryVer13(); OFTableStatsEntry entry = ofFactoryVer13.buildTableStatsEntry() .setTableId(TableId.of(11)) .setActiveCount(10) .setMatchedCount(U64.of(100001L)) .setLookupCount(U64.of(100002L)) .build(); TableStatsEntry result = OfTa... | @Mapping(source = "tableId.value", target = "tableId") @Mapping(source = "activeCount", target = "activeEntries") @Mapping(source = "lookupCount.value", target = "lookupCount") @Mapping(source = "matchedCount.value", target = "matchedCount") public abstract TableStatsEntry toTableStatsEntry(OFTableStatsEntry source); | OfTableStatsMapper { @Mapping(source = "tableId.value", target = "tableId") @Mapping(source = "activeCount", target = "activeEntries") @Mapping(source = "lookupCount.value", target = "lookupCount") @Mapping(source = "matchedCount.value", target = "matchedCount") public abstract TableStatsEntry toTableStatsEntry(OFTable... | OfTableStatsMapper { @Mapping(source = "tableId.value", target = "tableId") @Mapping(source = "activeCount", target = "activeEntries") @Mapping(source = "lookupCount.value", target = "lookupCount") @Mapping(source = "matchedCount.value", target = "matchedCount") public abstract TableStatsEntry toTableStatsEntry(OFTable... | OfTableStatsMapper { @Mapping(source = "tableId.value", target = "tableId") @Mapping(source = "activeCount", target = "activeEntries") @Mapping(source = "lookupCount.value", target = "lookupCount") @Mapping(source = "matchedCount.value", target = "matchedCount") public abstract TableStatsEntry toTableStatsEntry(OFTable... | OfTableStatsMapper { @Mapping(source = "tableId.value", target = "tableId") @Mapping(source = "activeCount", target = "activeEntries") @Mapping(source = "lookupCount.value", target = "lookupCount") @Mapping(source = "matchedCount.value", target = "matchedCount") public abstract TableStatsEntry toTableStatsEntry(OFTable... |
@Test public void testReservedPortCheck() { for (OFPort port : new OFPort[]{ OFPort.LOCAL, OFPort.ALL, OFPort.CONTROLLER, OFPort.ANY, OFPort.FLOOD, OFPort.NO_MASK, OFPort.IN_PORT, OFPort.NORMAL, OFPort.TABLE}) { Assert.assertTrue(String.format("Port %s must be detected as RESERVED, but it's not", port), OfPortDescConve... | public boolean isReservedPort(OFPort port) { return OFPort.MAX.getPortNumber() <= port.getPortNumber() && port.getPortNumber() <= -1; } | OfPortDescConverter { public boolean isReservedPort(OFPort port) { return OFPort.MAX.getPortNumber() <= port.getPortNumber() && port.getPortNumber() <= -1; } } | OfPortDescConverter { public boolean isReservedPort(OFPort port) { return OFPort.MAX.getPortNumber() <= port.getPortNumber() && port.getPortNumber() <= -1; } } | OfPortDescConverter { public boolean isReservedPort(OFPort port) { return OFPort.MAX.getPortNumber() <= port.getPortNumber() && port.getPortNumber() <= -1; } PortDescription toPortDescription(OFPortDesc ofPortDesc); PortInfoData toPortInfoData(DatapathId dpId, OFPortDesc portDesc,
... | OfPortDescConverter { public boolean isReservedPort(OFPort port) { return OFPort.MAX.getPortNumber() <= port.getPortNumber() && port.getPortNumber() <= -1; } PortDescription toPortDescription(OFPortDesc ofPortDesc); PortInfoData toPortInfoData(DatapathId dpId, OFPortDesc portDesc,
... |
@Test public void testPortChangeTypeMapping() { OFPortDesc portDesc = OFFactoryVer13.INSTANCE.buildPortDesc() .setPortNo(OFPort.of(1)) .setName("test") .build(); Map<org.openkilda.messaging.info.event.PortChangeType, net.floodlightcontroller.core.PortChangeType> expected = new HashMap<>(); expected.put(org.openkilda.me... | public PortInfoData toPortInfoData(DatapathId dpId, OFPortDesc portDesc, net.floodlightcontroller.core.PortChangeType type) { return new PortInfoData( new SwitchId(dpId.getLong()), portDesc.getPortNo().getPortNumber(), mapChangeType(type), isPortEnabled(portDesc)); } | OfPortDescConverter { public PortInfoData toPortInfoData(DatapathId dpId, OFPortDesc portDesc, net.floodlightcontroller.core.PortChangeType type) { return new PortInfoData( new SwitchId(dpId.getLong()), portDesc.getPortNo().getPortNumber(), mapChangeType(type), isPortEnabled(portDesc)); } } | OfPortDescConverter { public PortInfoData toPortInfoData(DatapathId dpId, OFPortDesc portDesc, net.floodlightcontroller.core.PortChangeType type) { return new PortInfoData( new SwitchId(dpId.getLong()), portDesc.getPortNo().getPortNumber(), mapChangeType(type), isPortEnabled(portDesc)); } } | OfPortDescConverter { public PortInfoData toPortInfoData(DatapathId dpId, OFPortDesc portDesc, net.floodlightcontroller.core.PortChangeType type) { return new PortInfoData( new SwitchId(dpId.getLong()), portDesc.getPortNo().getPortNumber(), mapChangeType(type), isPortEnabled(portDesc)); } PortDescription toPortDescrip... | OfPortDescConverter { public PortInfoData toPortInfoData(DatapathId dpId, OFPortDesc portDesc, net.floodlightcontroller.core.PortChangeType type) { return new PortInfoData( new SwitchId(dpId.getLong()), portDesc.getPortNo().getPortNumber(), mapChangeType(type), isPortEnabled(portDesc)); } PortDescription toPortDescrip... |
@Test public void testToPortStatsDataV13() { OFFactoryVer13 factory = new OFFactoryVer13(); OFMeterBandStats bandStats = factory.meterBandStats(U64.of(bandPacketCount), U64.of(bandByteCount)); OFMeterStats meterStats = factory.buildMeterStats() .setMeterId(meterId) .setByteInCount(U64.of(meterByteCount)) .setPacketInCo... | public MeterStatsData toMeterStatsData(List<OFMeterStatsReply> data, SwitchId switchId) { try { List<MeterStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toMeterStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new MeterStatsData(switchId, stats); } catch (Null... | OfMeterStatsMapper { public MeterStatsData toMeterStatsData(List<OFMeterStatsReply> data, SwitchId switchId) { try { List<MeterStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toMeterStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new MeterStatsData(switchId, ... | OfMeterStatsMapper { public MeterStatsData toMeterStatsData(List<OFMeterStatsReply> data, SwitchId switchId) { try { List<MeterStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toMeterStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new MeterStatsData(switchId, ... | OfMeterStatsMapper { public MeterStatsData toMeterStatsData(List<OFMeterStatsReply> data, SwitchId switchId) { try { List<MeterStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toMeterStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new MeterStatsData(switchId, ... | OfMeterStatsMapper { public MeterStatsData toMeterStatsData(List<OFMeterStatsReply> data, SwitchId switchId) { try { List<MeterStatsEntry> stats = data.stream() .flatMap(reply -> reply.getEntries().stream()) .map(this::toMeterStatsEntry) .filter(Objects::nonNull) .collect(toList()); return new MeterStatsData(switchId, ... |
@Test public void switchAdded() throws Exception { SpeakerSwitchView expectedSwitchView = makeSwitchRecord(dpId, switchFeatures, true, true); Capture<Message> producedMessage = prepareAliveSwitchEvent(expectedSwitchView); replayAll(); service.switchAdded(dpId); verifySwitchEvent(SwitchChangeType.ADDED, expectedSwitchVi... | @Override @NewCorrelationContextRequired public void switchAdded(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.ADDED); switchDiscovery(switchId, SwitchChangeType.ADDED); } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchAdded(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.ADDED); switchDiscovery(switchId, SwitchChangeType.ADDED); } } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchAdded(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.ADDED); switchDiscovery(switchId, SwitchChangeType.ADDED); } } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchAdded(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.ADDED); switchDiscovery(switchId, SwitchChangeType.ADDED); } void dumpAllSwitches(); void completeSwitchA... | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchAdded(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.ADDED); switchDiscovery(switchId, SwitchChangeType.ADDED); } void dumpAllSwitches(); void completeSwitchA... |
@Test public void switchAddedMissing() throws Exception { Capture<Message> producedMessage = prepareRemovedSwitchEvent(); replayAll(); service.switchAdded(dpId); verifySwitchEvent(SwitchChangeType.ADDED, null, producedMessage); } | @Override @NewCorrelationContextRequired public void switchAdded(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.ADDED); switchDiscovery(switchId, SwitchChangeType.ADDED); } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchAdded(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.ADDED); switchDiscovery(switchId, SwitchChangeType.ADDED); } } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchAdded(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.ADDED); switchDiscovery(switchId, SwitchChangeType.ADDED); } } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchAdded(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.ADDED); switchDiscovery(switchId, SwitchChangeType.ADDED); } void dumpAllSwitches(); void completeSwitchA... | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchAdded(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.ADDED); switchDiscovery(switchId, SwitchChangeType.ADDED); } void dumpAllSwitches(); void completeSwitchA... |
@Test public void switchRemoved() { Capture<Message> producedMessage = prepareSwitchEventCommon(dpId); switchManager.deactivate(eq(dpId)); replayAll(); service.switchRemoved(dpId); verifySwitchEvent(SwitchChangeType.REMOVED, null, producedMessage); } | @Override @NewCorrelationContextRequired public void switchRemoved(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.REMOVED); switchManager.deactivate(switchId); switchDiscovery(switchId, SwitchChangeType.REMOVED); } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchRemoved(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.REMOVED); switchManager.deactivate(switchId); switchDiscovery(switchId, SwitchChangeType.REMOVED); } } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchRemoved(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.REMOVED); switchManager.deactivate(switchId); switchDiscovery(switchId, SwitchChangeType.REMOVED); } } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchRemoved(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.REMOVED); switchManager.deactivate(switchId); switchDiscovery(switchId, SwitchChangeType.REMOVED); } vo... | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchRemoved(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.REMOVED); switchManager.deactivate(switchId); switchDiscovery(switchId, SwitchChangeType.REMOVED); } vo... |
@Test public void switchDeactivated() { Capture<Message> producedMessage = prepareSwitchEventCommon(dpId); switchManager.deactivate(eq(dpId)); replayAll(); service.switchDeactivated(dpId); verifySwitchEvent(SwitchChangeType.DEACTIVATED, null, producedMessage); } | @Override @NewCorrelationContextRequired public void switchDeactivated(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.DEACTIVATED); switchManager.deactivate(switchId); switchDiscovery(switchId, SwitchChangeType.DEACTIVATED); } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchDeactivated(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.DEACTIVATED); switchManager.deactivate(switchId); switchDiscovery(switchId, SwitchChangeType.DEACTIV... | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchDeactivated(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.DEACTIVATED); switchManager.deactivate(switchId); switchDiscovery(switchId, SwitchChangeType.DEACTIV... | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchDeactivated(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.DEACTIVATED); switchManager.deactivate(switchId); switchDiscovery(switchId, SwitchChangeType.DEACTIV... | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchDeactivated(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.DEACTIVATED); switchManager.deactivate(switchId); switchDiscovery(switchId, SwitchChangeType.DEACTIV... |
@Test public void shouldPatchSwitch() throws SwitchNotFoundException { Switch sw = Switch.builder().switchId(TEST_SWITCH_ID).status(SwitchStatus.ACTIVE).build(); switchRepository.add(sw); SwitchPatch switchPatch = new SwitchPatch("pop", new SwitchLocation(48.860611, 2.337633, "street", "city", "country")); switchOperat... | public Switch patchSwitch(SwitchId switchId, SwitchPatch data) throws SwitchNotFoundException { return transactionManager.doInTransaction(() -> { Switch foundSwitch = switchRepository.findById(switchId) .orElseThrow(() -> new SwitchNotFoundException(switchId)); Optional.ofNullable(data.getPop()).ifPresent(pop -> foundS... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public Switch patchSwitch(SwitchId switchId, SwitchPatch data) throws SwitchNotFoundException { return transactionManager.doInTransaction(() -> { Switch foundSwitch = switchRepository.findById(switchId) .orElseThrow(() -> new SwitchNotFoundException(swi... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public Switch patchSwitch(SwitchId switchId, SwitchPatch data) throws SwitchNotFoundException { return transactionManager.doInTransaction(() -> { Switch foundSwitch = switchRepository.findById(switchId) .orElseThrow(() -> new SwitchNotFoundException(swi... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public Switch patchSwitch(SwitchId switchId, SwitchPatch data) throws SwitchNotFoundException { return transactionManager.doInTransaction(() -> { Switch foundSwitch = switchRepository.findById(switchId) .orElseThrow(() -> new SwitchNotFoundException(swi... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public Switch patchSwitch(SwitchId switchId, SwitchPatch data) throws SwitchNotFoundException { return transactionManager.doInTransaction(() -> { Switch foundSwitch = switchRepository.findById(switchId) .orElseThrow(() -> new SwitchNotFoundException(swi... |
@Test public void switchChanged() throws Exception { SpeakerSwitchView expectedSwitchRecord = makeSwitchRecord(dpId, switchFeatures, true, true); Capture<Message> producedMessage = prepareAliveSwitchEvent(expectedSwitchRecord); replayAll(); service.switchChanged(dpId); verifySwitchEvent(SwitchChangeType.CHANGED, expect... | @Override @NewCorrelationContextRequired public void switchChanged(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.CHANGED); switchDiscovery(switchId, SwitchChangeType.CHANGED); } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchChanged(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.CHANGED); switchDiscovery(switchId, SwitchChangeType.CHANGED); } } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchChanged(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.CHANGED); switchDiscovery(switchId, SwitchChangeType.CHANGED); } } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchChanged(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.CHANGED); switchDiscovery(switchId, SwitchChangeType.CHANGED); } void dumpAllSwitches(); void completeS... | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchChanged(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.CHANGED); switchDiscovery(switchId, SwitchChangeType.CHANGED); } void dumpAllSwitches(); void completeS... |
@Test public void switchChangedMissing() throws Exception { Capture<Message> producedMessage = prepareRemovedSwitchEvent(); replayAll(); service.switchChanged(dpId); verifySwitchEvent(SwitchChangeType.CHANGED, null, producedMessage); } | @Override @NewCorrelationContextRequired public void switchChanged(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.CHANGED); switchDiscovery(switchId, SwitchChangeType.CHANGED); } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchChanged(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.CHANGED); switchDiscovery(switchId, SwitchChangeType.CHANGED); } } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchChanged(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.CHANGED); switchDiscovery(switchId, SwitchChangeType.CHANGED); } } | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchChanged(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.CHANGED); switchDiscovery(switchId, SwitchChangeType.CHANGED); } void dumpAllSwitches(); void completeS... | SwitchTrackingService implements IOFSwitchListener, IService { @Override @NewCorrelationContextRequired public void switchChanged(final DatapathId switchId) { dashboardLogger.onSwitchEvent(switchId, SwitchChangeType.CHANGED); switchDiscovery(switchId, SwitchChangeType.CHANGED); } void dumpAllSwitches(); void completeS... |
@Test public void networkDumpTest() throws Exception { OFSwitch iofSwitch1 = mock(OFSwitch.class); OFSwitch iofSwitch2 = mock(OFSwitch.class); final DatapathId swAid = DatapathId.of(1); final DatapathId swBid = DatapathId.of(2); Map<DatapathId, IOFSwitch> switches = ImmutableMap.of( swAid, iofSwitch1, swBid, iofSwitch2... | public void dumpAllSwitches() { discoveryLock.writeLock().lock(); try { dumpAllSwitchesAction(); } finally { discoveryLock.writeLock().unlock(); } } | SwitchTrackingService implements IOFSwitchListener, IService { public void dumpAllSwitches() { discoveryLock.writeLock().lock(); try { dumpAllSwitchesAction(); } finally { discoveryLock.writeLock().unlock(); } } } | SwitchTrackingService implements IOFSwitchListener, IService { public void dumpAllSwitches() { discoveryLock.writeLock().lock(); try { dumpAllSwitchesAction(); } finally { discoveryLock.writeLock().unlock(); } } } | SwitchTrackingService implements IOFSwitchListener, IService { public void dumpAllSwitches() { discoveryLock.writeLock().lock(); try { dumpAllSwitchesAction(); } finally { discoveryLock.writeLock().unlock(); } } void dumpAllSwitches(); void completeSwitchActivation(DatapathId dpId); @Override @NewCorrelationContextReq... | SwitchTrackingService implements IOFSwitchListener, IService { public void dumpAllSwitches() { discoveryLock.writeLock().lock(); try { dumpAllSwitchesAction(); } finally { discoveryLock.writeLock().unlock(); } } void dumpAllSwitches(); void completeSwitchActivation(DatapathId dpId); @Override @NewCorrelationContextReq... |
@Test public void installDropRule() throws Exception { Capture<OFFlowMod> capture = prepareForInstallTest(); switchManager.installDropFlow(defaultDpid); assertEquals(scheme.installDropFlowRule(), capture.getValue()); } | @Override public Long installDropFlow(final DatapathId dpid) throws SwitchOperationException { return installDropFlowForTable(dpid, INPUT_TABLE_ID, DROP_RULE_COOKIE); } | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installDropFlow(final DatapathId dpid) throws SwitchOperationException { return installDropFlowForTable(dpid, INPUT_TABLE_ID, DROP_RULE_COOKIE); } } | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installDropFlow(final DatapathId dpid) throws SwitchOperationException { return installDropFlowForTable(dpid, INPUT_TABLE_ID, DROP_RULE_COOKIE); } } | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installDropFlow(final DatapathId dpid) throws SwitchOperationException { return installDropFlowForTable(dpid, INPUT_TABLE_ID, DROP_RULE_COOKIE); } @Override Collection<Class<? extends IFloodlightS... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installDropFlow(final DatapathId dpid) throws SwitchOperationException { return installDropFlowForTable(dpid, INPUT_TABLE_ID, DROP_RULE_COOKIE); } @Override Collection<Class<? extends IFloodlightS... |
@Test public void installVerificationUnicastRule() throws Exception { mockGetMetersRequest(Lists.newArrayList(broadcastMeterId), true, 10L); mockBarrierRequest(); expect(iofSwitch.write(anyObject(OFMeterMod.class))).andReturn(true).times(1); Capture<OFFlowMod> capture = prepareForInstallTest(); switchManager.installVer... | @Override public Long installVerificationRule(final DatapathId dpid, final boolean isBroadcast) throws SwitchOperationException { String ruleName = (isBroadcast) ? "Broadcast" : "Unicast"; String flowName = ruleName + "--VerificationFlow--"; return installDefaultFlow(dpid, switchFlowFactory.getVerificationFlow(isBroadc... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installVerificationRule(final DatapathId dpid, final boolean isBroadcast) throws SwitchOperationException { String ruleName = (isBroadcast) ? "Broadcast" : "Unicast"; String flowName = ruleName + "... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installVerificationRule(final DatapathId dpid, final boolean isBroadcast) throws SwitchOperationException { String ruleName = (isBroadcast) ? "Broadcast" : "Unicast"; String flowName = ruleName + "... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installVerificationRule(final DatapathId dpid, final boolean isBroadcast) throws SwitchOperationException { String ruleName = (isBroadcast) ? "Broadcast" : "Unicast"; String flowName = ruleName + "... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installVerificationRule(final DatapathId dpid, final boolean isBroadcast) throws SwitchOperationException { String ruleName = (isBroadcast) ? "Broadcast" : "Unicast"; String flowName = ruleName + "... |
@Test public void installDropLoopRule() throws Exception { Capture<OFFlowMod> capture = prepareForInstallTest(); switchManager.installDropLoopRule(dpid); OFFlowMod result = capture.getValue(); assertEquals(scheme.installDropLoopRule(dpid), result); } | @Override public Long installDropLoopRule(DatapathId dpid) throws SwitchOperationException { return installDefaultFlow(dpid, switchFlowFactory.getDropLoopFlowGenerator(), "--DropLoopRule--"); } | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installDropLoopRule(DatapathId dpid) throws SwitchOperationException { return installDefaultFlow(dpid, switchFlowFactory.getDropLoopFlowGenerator(), "--DropLoopRule--"); } } | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installDropLoopRule(DatapathId dpid) throws SwitchOperationException { return installDefaultFlow(dpid, switchFlowFactory.getDropLoopFlowGenerator(), "--DropLoopRule--"); } } | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installDropLoopRule(DatapathId dpid) throws SwitchOperationException { return installDefaultFlow(dpid, switchFlowFactory.getDropLoopFlowGenerator(), "--DropLoopRule--"); } @Override Collection<Cla... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installDropLoopRule(DatapathId dpid) throws SwitchOperationException { return installDefaultFlow(dpid, switchFlowFactory.getDropLoopFlowGenerator(), "--DropLoopRule--"); } @Override Collection<Cla... |
@Test public void installDropFlowForTable() throws Exception { Capture<OFFlowMod> capture = prepareForInstallTest(); switchManager.installDropFlowForTable(dpid, 1, DROP_RULE_COOKIE); OFFlowMod result = capture.getValue(); assertEquals(scheme.installDropFlowForTable(dpid, 1, DROP_RULE_COOKIE), result); } | @Override public Long installDropFlowForTable(final DatapathId dpid, final int tableId, final long cookie) throws SwitchOperationException { return installDefaultFlow(dpid, switchFlowFactory.getDropFlowGenerator(cookie, tableId), "--DropRule--"); } | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installDropFlowForTable(final DatapathId dpid, final int tableId, final long cookie) throws SwitchOperationException { return installDefaultFlow(dpid, switchFlowFactory.getDropFlowGenerator(cookie,... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installDropFlowForTable(final DatapathId dpid, final int tableId, final long cookie) throws SwitchOperationException { return installDefaultFlow(dpid, switchFlowFactory.getDropFlowGenerator(cookie,... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installDropFlowForTable(final DatapathId dpid, final int tableId, final long cookie) throws SwitchOperationException { return installDefaultFlow(dpid, switchFlowFactory.getDropFlowGenerator(cookie,... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public Long installDropFlowForTable(final DatapathId dpid, final int tableId, final long cookie) throws SwitchOperationException { return installDefaultFlow(dpid, switchFlowFactory.getDropFlowGenerator(cookie,... |
@Test public void installEgressIslVxlanRule() throws Exception { Capture<OFFlowMod> capture = prepareForInstallTest(); switchManager.installEgressIslVxlanRule(dpid, 1); OFFlowMod result = capture.getValue(); assertEquals(scheme.installEgressIslVxlanRule(dpid, 1), result); } | @Override public long installEgressIslVxlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildEgressIslVxlanRule(ofFactory, dpid, port); String flowName = "--Isl egress rule for VXLAN--" + dpid.toString()... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public long installEgressIslVxlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildEgressIsl... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public long installEgressIslVxlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildEgressIsl... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public long installEgressIslVxlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildEgressIsl... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public long installEgressIslVxlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildEgressIsl... |
@Test public void installTransitIslVxlanRule() throws Exception { Capture<OFFlowMod> capture = prepareForInstallTest(); switchManager.installTransitIslVxlanRule(dpid, 1); OFFlowMod result = capture.getValue(); assertEquals(scheme.installTransitIslVxlanRule(dpid, 1), result); } | @Override public long installTransitIslVxlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildTransitIslVxlanRule(ofFactory, port); String flowName = "--Isl transit rule for VXLAN--" + dpid.toString(); p... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public long installTransitIslVxlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildTransitI... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public long installTransitIslVxlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildTransitI... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public long installTransitIslVxlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildTransitI... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public long installTransitIslVxlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildTransitI... |
@Test public void installEgressIslVlanRule() throws Exception { Capture<OFFlowMod> capture = prepareForInstallTest(); switchManager.installEgressIslVlanRule(dpid, 1); OFFlowMod result = capture.getValue(); assertEquals(scheme.installEgressIslVlanRule(dpid, 1), result); } | @Override public long installEgressIslVlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildEgressIslVlanRule(ofFactory, port); String flowName = "--Isl egress rule for VLAN--" + dpid.toString(); pushFlo... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public long installEgressIslVlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildEgressIslV... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public long installEgressIslVlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildEgressIslV... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public long installEgressIslVlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildEgressIslV... | SwitchManager implements IFloodlightModule, IFloodlightService, ISwitchManager, IOFMessageListener { @Override public long installEgressIslVlanRule(DatapathId dpid, int port) throws SwitchOperationException { IOFSwitch sw = lookupSwitch(dpid); OFFactory ofFactory = sw.getOFFactory(); OFFlowMod flowMod = buildEgressIslV... |
@Test public void shouldSetNullPopWhenPopIsEmptyString() throws SwitchNotFoundException { Switch sw = Switch.builder().switchId(TEST_SWITCH_ID).status(SwitchStatus.ACTIVE).build(); switchRepository.add(sw); SwitchPatch switchPatch = new SwitchPatch("", null); switchOperationsService.patchSwitch(TEST_SWITCH_ID, switchPa... | public Switch patchSwitch(SwitchId switchId, SwitchPatch data) throws SwitchNotFoundException { return transactionManager.doInTransaction(() -> { Switch foundSwitch = switchRepository.findById(switchId) .orElseThrow(() -> new SwitchNotFoundException(switchId)); Optional.ofNullable(data.getPop()).ifPresent(pop -> foundS... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public Switch patchSwitch(SwitchId switchId, SwitchPatch data) throws SwitchNotFoundException { return transactionManager.doInTransaction(() -> { Switch foundSwitch = switchRepository.findById(switchId) .orElseThrow(() -> new SwitchNotFoundException(swi... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public Switch patchSwitch(SwitchId switchId, SwitchPatch data) throws SwitchNotFoundException { return transactionManager.doInTransaction(() -> { Switch foundSwitch = switchRepository.findById(switchId) .orElseThrow(() -> new SwitchNotFoundException(swi... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public Switch patchSwitch(SwitchId switchId, SwitchPatch data) throws SwitchNotFoundException { return transactionManager.doInTransaction(() -> { Switch foundSwitch = switchRepository.findById(switchId) .orElseThrow(() -> new SwitchNotFoundException(swi... | SwitchOperationsService implements ILinkOperationsServiceCarrier { public Switch patchSwitch(SwitchId switchId, SwitchPatch data) throws SwitchNotFoundException { return transactionManager.doInTransaction(() -> { Switch foundSwitch = switchRepository.findById(switchId) .orElseThrow(() -> new SwitchNotFoundException(swi... |
@Test public void testConnectSchemaMetadataTranslation() { assertEquals(new SchemaAndValue(Schema.BOOLEAN_SCHEMA, true), converter.toConnectData(TOPIC, "{ \"schema\": { \"type\": \"boolean\" }, \"payload\": true }".getBytes())); assertEquals(new SchemaAndValue(Schema.OPTIONAL_BOOLEAN_SCHEMA, null), converter.toConnectD... | @Override public SchemaAndValue toConnectData(String topic, byte[] value) { JsonNode jsonValue; try { jsonValue = deserializer.deserialize(topic, value); } catch (SerializationException e) { throw new DataException("Converting byte[] to Kafka Connect data failed due to serialization error: ", e); } if (enableSchemas &&... | JsonConverter implements Converter { @Override public SchemaAndValue toConnectData(String topic, byte[] value) { JsonNode jsonValue; try { jsonValue = deserializer.deserialize(topic, value); } catch (SerializationException e) { throw new DataException("Converting byte[] to Kafka Connect data failed due to serialization... | JsonConverter implements Converter { @Override public SchemaAndValue toConnectData(String topic, byte[] value) { JsonNode jsonValue; try { jsonValue = deserializer.deserialize(topic, value); } catch (SerializationException e) { throw new DataException("Converting byte[] to Kafka Connect data failed due to serialization... | JsonConverter implements Converter { @Override public SchemaAndValue toConnectData(String topic, byte[] value) { JsonNode jsonValue; try { jsonValue = deserializer.deserialize(topic, value); } catch (SerializationException e) { throw new DataException("Converting byte[] to Kafka Connect data failed due to serialization... | JsonConverter implements Converter { @Override public SchemaAndValue toConnectData(String topic, byte[] value) { JsonNode jsonValue; try { jsonValue = deserializer.deserialize(topic, value); } catch (SerializationException e) { throw new DataException("Converting byte[] to Kafka Connect data failed due to serialization... |
@Test public void shouldRebalanceTasksToClientsBasedOnCapacity() throws Exception { createClientWithPreviousActiveTasks(p2, 1, task00, task03, task02); createClient(p3, 2); final StickyTaskAssignor<Integer> taskAssignor = createTaskAssignor(task00, task02, task03); taskAssignor.assign(0); assertThat(clients.get(p2).ass... | @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } |
@Test public void shouldMoveMinimalNumberOfTasksWhenPreviouslyAboveCapacityAndNewClientAdded() throws Exception { final Set<TaskId> p1PrevTasks = Utils.mkSet(task00, task02); final Set<TaskId> p2PrevTasks = Utils.mkSet(task01, task03); createClientWithPreviousActiveTasks(p1, 1, task00, task02); createClientWithPrevious... | @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } |
@Test public void shouldNotMoveAnyTasksWhenNewTasksAdded() throws Exception { createClientWithPreviousActiveTasks(p1, 1, task00, task01); createClientWithPreviousActiveTasks(p2, 1, task02, task03); final StickyTaskAssignor<Integer> taskAssignor = createTaskAssignor(task03, task01, task04, task02, task00, task05); taskA... | @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } |
@Test public void shouldAssignNewTasksToNewClientWhenPreviousTasksAssignedToOldClients() throws Exception { createClientWithPreviousActiveTasks(p1, 1, task02, task01); createClientWithPreviousActiveTasks(p2, 1, task00, task03); createClient(p3, 1); final StickyTaskAssignor<Integer> taskAssignor = createTaskAssignor(tas... | @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } |
@Test public void shouldAssignTasksNotPreviouslyActiveToNewClient() throws Exception { final TaskId task10 = new TaskId(0, 10); final TaskId task11 = new TaskId(0, 11); final TaskId task12 = new TaskId(1, 2); final TaskId task13 = new TaskId(1, 3); final TaskId task20 = new TaskId(2, 0); final TaskId task21 = new TaskI... | @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } |
@Test public void shouldAssignTasksNotPreviouslyActiveToMultipleNewClients() throws Exception { final TaskId task10 = new TaskId(0, 10); final TaskId task11 = new TaskId(0, 11); final TaskId task12 = new TaskId(1, 2); final TaskId task13 = new TaskId(1, 3); final TaskId task20 = new TaskId(2, 0); final TaskId task21 = ... | @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } |
@Test public void shouldAssignTasksToNewClient() throws Exception { createClientWithPreviousActiveTasks(p1, 1, task01, task02); createClient(p2, 1); createTaskAssignor(task01, task02).assign(0); assertThat(clients.get(p1).activeTaskCount(), equalTo(1)); } | @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } |
@Test public void shouldAssignTasksToNewClientWithoutFlippingAssignmentBetweenExistingClients() throws Exception { final ClientState c1 = createClientWithPreviousActiveTasks(p1, 1, task00, task01, task02); final ClientState c2 = createClientWithPreviousActiveTasks(p2, 1, task03, task04, task05); final ClientState newCl... | @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } |
@Test public void shouldAssignTasksToNewClientWithoutFlippingAssignmentBetweenExistingAndBouncedClients() throws Exception { final TaskId task06 = new TaskId(0, 6); final ClientState c1 = createClientWithPreviousActiveTasks(p1, 1, task00, task01, task02, task06); final ClientState c2 = createClient(p2, 1); c2.addPrevio... | @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } | StickyTaskAssignor implements TaskAssignor<ID, TaskId> { @Override public void assign(final int numStandbyReplicas) { assignActive(); assignStandby(numStandbyReplicas); } StickyTaskAssignor(final Map<ID, ClientState> clients, final Set<TaskId> taskIds); @Override void assign(final int numStandbyReplicas); } |
@Test public void shouldBeBackwardCompatible() throws Exception { UUID processId = UUID.randomUUID(); Set<TaskId> activeTasks = new HashSet<>(Arrays.asList(new TaskId(0, 0), new TaskId(0, 1), new TaskId(1, 0))); Set<TaskId> standbyTasks = new HashSet<>(Arrays.asList(new TaskId(1, 1), new TaskId(2, 0))); final ByteBuffe... | public static SubscriptionInfo decode(ByteBuffer data) { data.rewind(); int version = data.getInt(); if (version == CURRENT_VERSION || version == 1) { UUID processId = new UUID(data.getLong(), data.getLong()); Set<TaskId> prevTasks = new HashSet<>(); int numPrevs = data.getInt(); for (int i = 0; i < numPrevs; i++) { Ta... | SubscriptionInfo { public static SubscriptionInfo decode(ByteBuffer data) { data.rewind(); int version = data.getInt(); if (version == CURRENT_VERSION || version == 1) { UUID processId = new UUID(data.getLong(), data.getLong()); Set<TaskId> prevTasks = new HashSet<>(); int numPrevs = data.getInt(); for (int i = 0; i < ... | SubscriptionInfo { public static SubscriptionInfo decode(ByteBuffer data) { data.rewind(); int version = data.getInt(); if (version == CURRENT_VERSION || version == 1) { UUID processId = new UUID(data.getLong(), data.getLong()); Set<TaskId> prevTasks = new HashSet<>(); int numPrevs = data.getInt(); for (int i = 0; i < ... | SubscriptionInfo { public static SubscriptionInfo decode(ByteBuffer data) { data.rewind(); int version = data.getInt(); if (version == CURRENT_VERSION || version == 1) { UUID processId = new UUID(data.getLong(), data.getLong()); Set<TaskId> prevTasks = new HashSet<>(); int numPrevs = data.getInt(); for (int i = 0; i < ... | SubscriptionInfo { public static SubscriptionInfo decode(ByteBuffer data) { data.rewind(); int version = data.getInt(); if (version == CURRENT_VERSION || version == 1) { UUID processId = new UUID(data.getLong(), data.getLong()); Set<TaskId> prevTasks = new HashSet<>(); int numPrevs = data.getInt(); for (int i = 0; i < ... |
@Test(expected = NotFoundException.class) public void testGetConnectorConfigConnectorNotFound() throws Throwable { final Capture<Callback<Map<String, String>>> cb = Capture.newInstance(); herder.connectorConfig(EasyMock.eq(CONNECTOR_NAME), EasyMock.capture(cb)); expectAndCallbackException(cb, new NotFoundException("not... | @GET @Path("/{connector}/config") public Map<String, String> getConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<Map<String, String>> cb = new FutureCallback<>(); herder.connectorConfig(connector, cb); return completeOrForwar... | ConnectorsResource { @GET @Path("/{connector}/config") public Map<String, String> getConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<Map<String, String>> cb = new FutureCallback<>(); herder.connectorConfig(connector, cb); re... | ConnectorsResource { @GET @Path("/{connector}/config") public Map<String, String> getConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<Map<String, String>> cb = new FutureCallback<>(); herder.connectorConfig(connector, cb); re... | ConnectorsResource { @GET @Path("/{connector}/config") public Map<String, String> getConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<Map<String, String>> cb = new FutureCallback<>(); herder.connectorConfig(connector, cb); re... | ConnectorsResource { @GET @Path("/{connector}/config") public Map<String, String> getConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<Map<String, String>> cb = new FutureCallback<>(); herder.connectorConfig(connector, cb); re... |
@Test public void shouldHaveNotReachedCapacityWhenAssignedTasksLessThanCapacity() throws Exception { assertFalse(client.reachedCapacity()); } | boolean reachedCapacity() { return assignedTasks.size() >= capacity; } | ClientState { boolean reachedCapacity() { return assignedTasks.size() >= capacity; } } | ClientState { boolean reachedCapacity() { return assignedTasks.size() >= capacity; } ClientState(); ClientState(final int capacity); private ClientState(Set<TaskId> activeTasks, Set<TaskId> standbyTasks, Set<TaskId> assignedTasks, Set<TaskId> prevActiveTasks, Set<TaskId> prevAssignedTasks, int capacity); } | ClientState { boolean reachedCapacity() { return assignedTasks.size() >= capacity; } ClientState(); ClientState(final int capacity); private ClientState(Set<TaskId> activeTasks, Set<TaskId> standbyTasks, Set<TaskId> assignedTasks, Set<TaskId> prevActiveTasks, Set<TaskId> prevAssignedTasks, int capacity); ClientState... | ClientState { boolean reachedCapacity() { return assignedTasks.size() >= capacity; } ClientState(); ClientState(final int capacity); private ClientState(Set<TaskId> activeTasks, Set<TaskId> standbyTasks, Set<TaskId> assignedTasks, Set<TaskId> prevActiveTasks, Set<TaskId> prevAssignedTasks, int capacity); ClientState... |
@Test public void shouldHaveMoreAvailableCapacityWhenCapacityHigherAndSameAssignedTaskCount() throws Exception { final ClientState c2 = new ClientState(2); assertTrue(c2.hasMoreAvailableCapacityThan(client)); assertFalse(client.hasMoreAvailableCapacityThan(c2)); } | boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final double otherLoa... | ClientState { boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final d... | ClientState { boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final d... | ClientState { boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final d... | ClientState { boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final d... |
@Test(expected = IllegalStateException.class) public void shouldThrowIllegalStateExceptionIfCapacityOfThisClientStateIsZero() throws Exception { final ClientState c1 = new ClientState(0); c1.hasMoreAvailableCapacityThan(new ClientState(1)); } | boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final double otherLoa... | ClientState { boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final d... | ClientState { boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final d... | ClientState { boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final d... | ClientState { boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final d... |
@Test(expected = IllegalStateException.class) public void shouldThrowIllegalStateExceptionIfCapacityOfOtherClientStateIsZero() throws Exception { final ClientState c1 = new ClientState(1); c1.hasMoreAvailableCapacityThan(new ClientState(0)); } | boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final double otherLoa... | ClientState { boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final d... | ClientState { boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final d... | ClientState { boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final d... | ClientState { boolean hasMoreAvailableCapacityThan(final ClientState other) { if (this.capacity <= 0) { throw new IllegalStateException("Capacity of this ClientState must be greater than 0."); } if (other.capacity <= 0) { throw new IllegalStateException("Capacity of other ClientState must be greater than 0"); } final d... |
@SuppressWarnings("unchecked") @Test public void testUnite() { QuickUnion<Long> qu = new QuickUnion<>(); long[] ids = { 1L, 2L, 3L, 4L, 5L }; for (long id : ids) { qu.add(id); } assertEquals(5, roots(qu, ids).size()); qu.unite(1L, 2L); assertEquals(4, roots(qu, ids).size()); assertEquals(qu.root(1L), qu.root(2L)); qu.u... | public void unite(T id1, T... idList) { for (T id2 : idList) { unitePair(id1, id2); } } | QuickUnion { public void unite(T id1, T... idList) { for (T id2 : idList) { unitePair(id1, id2); } } } | QuickUnion { public void unite(T id1, T... idList) { for (T id2 : idList) { unitePair(id1, id2); } } } | QuickUnion { public void unite(T id1, T... idList) { for (T id2 : idList) { unitePair(id1, id2); } } void add(T id); boolean exists(T id); T root(T id); void unite(T id1, T... idList); } | QuickUnion { public void unite(T id1, T... idList) { for (T id2 : idList) { unitePair(id1, id2); } } void add(T id); boolean exists(T id); T root(T id); void unite(T id1, T... idList); } |
@SuppressWarnings("unchecked") @Test public void shouldThrowStreamsExceptionWhenTimeoutExceptionThrown() throws Exception { final MockConsumer<byte[], byte[]> consumer = new MockConsumer(OffsetResetStrategy.EARLIEST) { @Override public Map<String, List<PartitionInfo>> listTopics() { throw new TimeoutException("KABOOM!"... | @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { log.warn("{} Could not list topics so will fall back... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... |
@Test(expected = StreamsException.class) public void shouldThrowStreamsExceptionIfPartitionDoesntExistAfterMaxWait() throws Exception { changelogReader.validatePartitionExists(topicPartition, "store"); } | @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { log.warn("{} Could not list topics so will fall back... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... |
@SuppressWarnings("unchecked") @Test public void shouldFallbackToPartitionsForIfPartitionNotInAllPartitionsList() throws Exception { final MockConsumer<byte[], byte[]> consumer = new MockConsumer(OffsetResetStrategy.EARLIEST) { @Override public List<PartitionInfo> partitionsFor(final String topic) { return Collections.... | @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { log.warn("{} Could not list topics so will fall back... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... |
@SuppressWarnings("unchecked") @Test public void shouldThrowStreamsExceptionIfTimeoutOccursDuringPartitionsFor() throws Exception { final MockConsumer<byte[], byte[]> consumer = new MockConsumer(OffsetResetStrategy.EARLIEST) { @Override public List<PartitionInfo> partitionsFor(final String topic) { throw new TimeoutExc... | @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { log.warn("{} Could not list topics so will fall back... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... |
@Test public void shouldPassIfTopicPartitionExists() throws Exception { consumer.updatePartitions(topicPartition.topic(), Collections.singletonList(partitionInfo)); changelogReader.validatePartitionExists(topicPartition, "store"); } | @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { log.warn("{} Could not list topics so will fall back... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... |
@Test public void testPutConnectorConfig() throws Throwable { final Capture<Callback<Herder.Created<ConnectorInfo>>> cb = Capture.newInstance(); herder.putConnectorConfig(EasyMock.eq(CONNECTOR_NAME), EasyMock.eq(CONNECTOR_CONFIG), EasyMock.eq(true), EasyMock.capture(cb)); expectAndCallbackResult(cb, new Herder.Created<... | @PUT @Path("/{connector}/config") public Response putConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward, final Map<String, String> connectorConfig) throws Throwable { FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>(); String includedName ... | ConnectorsResource { @PUT @Path("/{connector}/config") public Response putConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward, final Map<String, String> connectorConfig) throws Throwable { FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>();... | ConnectorsResource { @PUT @Path("/{connector}/config") public Response putConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward, final Map<String, String> connectorConfig) throws Throwable { FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>();... | ConnectorsResource { @PUT @Path("/{connector}/config") public Response putConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward, final Map<String, String> connectorConfig) throws Throwable { FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>();... | ConnectorsResource { @PUT @Path("/{connector}/config") public Response putConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward, final Map<String, String> connectorConfig) throws Throwable { FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>();... |
@SuppressWarnings("unchecked") @Test public void shouldRequestPartitionInfoIfItDoesntExist() throws Exception { final MockConsumer<byte[], byte[]> consumer = new MockConsumer(OffsetResetStrategy.EARLIEST) { @Override public Map<String, List<PartitionInfo>> listTopics() { return Collections.emptyMap(); } }; consumer.upd... | @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { log.warn("{} Could not list topics so will fall back... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... | StoreChangelogReader implements ChangelogReader { @Override public void validatePartitionExists(final TopicPartition topicPartition, final String storeName) { final long start = time.milliseconds(); if (partitionInfo.isEmpty()) { try { partitionInfo.putAll(consumer.listTopics()); } catch (final TimeoutException e) { lo... |
@Test public void shouldThrowExceptionIfConsumerHasCurrentSubscription() throws Exception { consumer.subscribe(Collections.singleton("sometopic")); try { changelogReader.restore(); fail("Should have thrown IllegalStateException"); } catch (final IllegalStateException e) { } } | public void restore() { final long start = time.milliseconds(); try { if (!consumer.subscription().isEmpty()) { throw new IllegalStateException(String.format("Restore consumer should have not subscribed to any partitions (%s) beforehand", consumer.subscription())); } final Map<TopicPartition, Long> endOffsets = consume... | StoreChangelogReader implements ChangelogReader { public void restore() { final long start = time.milliseconds(); try { if (!consumer.subscription().isEmpty()) { throw new IllegalStateException(String.format("Restore consumer should have not subscribed to any partitions (%s) beforehand", consumer.subscription())); } fi... | StoreChangelogReader implements ChangelogReader { public void restore() { final long start = time.milliseconds(); try { if (!consumer.subscription().isEmpty()) { throw new IllegalStateException(String.format("Restore consumer should have not subscribed to any partitions (%s) beforehand", consumer.subscription())); } fi... | StoreChangelogReader implements ChangelogReader { public void restore() { final long start = time.milliseconds(); try { if (!consumer.subscription().isEmpty()) { throw new IllegalStateException(String.format("Restore consumer should have not subscribed to any partitions (%s) beforehand", consumer.subscription())); } fi... | StoreChangelogReader implements ChangelogReader { public void restore() { final long start = time.milliseconds(); try { if (!consumer.subscription().isEmpty()) { throw new IllegalStateException(String.format("Restore consumer should have not subscribed to any partitions (%s) beforehand", consumer.subscription())); } fi... |
@Test public void shouldReturnCorrectPartitionCounts() throws Exception { InternalTopicManager internalTopicManager = new InternalTopicManager(streamsKafkaClient, 1, WINDOW_CHANGE_LOG_ADDITIONAL_RETENTION_DEFAULT, time); Assert.assertEquals(Collections.singletonMap(topic, 1), internalTopicManager.getNumPartitions(Colle... | public Map<String, Integer> getNumPartitions(final Set<String> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); existingTopicPartitions.... | InternalTopicManager { public Map<String, Integer> getNumPartitions(final Set<String> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); e... | InternalTopicManager { public Map<String, Integer> getNumPartitions(final Set<String> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); e... | InternalTopicManager { public Map<String, Integer> getNumPartitions(final Set<String> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); e... | InternalTopicManager { public Map<String, Integer> getNumPartitions(final Set<String> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); e... |
@Test public void shouldCreateRequiredTopics() throws Exception { InternalTopicManager internalTopicManager = new InternalTopicManager(streamsKafkaClient, 1, WINDOW_CHANGE_LOG_ADDITIONAL_RETENTION_DEFAULT, time); internalTopicManager.makeReady(Collections.singletonMap(new InternalTopicConfig(topic, Collections.singleto... | public void makeReady(final Map<InternalTopicConfig, Integer> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); final Map<InternalTopicCo... | InternalTopicManager { public void makeReady(final Map<InternalTopicConfig, Integer> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); fi... | InternalTopicManager { public void makeReady(final Map<InternalTopicConfig, Integer> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); fi... | InternalTopicManager { public void makeReady(final Map<InternalTopicConfig, Integer> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); fi... | InternalTopicManager { public void makeReady(final Map<InternalTopicConfig, Integer> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); fi... |
@Test public void shouldNotCreateTopicIfExistsWithDifferentPartitions() throws Exception { InternalTopicManager internalTopicManager = new InternalTopicManager(streamsKafkaClient, 1, WINDOW_CHANGE_LOG_ADDITIONAL_RETENTION_DEFAULT, time); boolean exceptionWasThrown = false; try { internalTopicManager.makeReady(Collectio... | public void makeReady(final Map<InternalTopicConfig, Integer> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); final Map<InternalTopicCo... | InternalTopicManager { public void makeReady(final Map<InternalTopicConfig, Integer> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); fi... | InternalTopicManager { public void makeReady(final Map<InternalTopicConfig, Integer> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); fi... | InternalTopicManager { public void makeReady(final Map<InternalTopicConfig, Integer> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); fi... | InternalTopicManager { public void makeReady(final Map<InternalTopicConfig, Integer> topics) { for (int i = 0; i < MAX_TOPIC_READY_TRY; i++) { try { final MetadataResponse metadata = streamsKafkaClient.fetchMetadata(); final Map<String, Integer> existingTopicPartitions = fetchExistingPartitionCountByTopic(metadata); fi... |
@Test(expected = ProcessorStateException.class) public void shouldThrowProcessorStateExceptionOnInitializeOffsetsWhenAuthorizationException() throws Exception { final Consumer consumer = mockConsumer(new AuthorizationException("blah")); final AbstractTask task = createTask(consumer); task.updateOffsetLimits(); } | protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } catch (final Auth... | AbstractTask { protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } ca... | AbstractTask { protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } ca... | AbstractTask { protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } ca... | AbstractTask { protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } ca... |
@Test(expected = ProcessorStateException.class) public void shouldThrowProcessorStateExceptionOnInitializeOffsetsWhenKafkaException() throws Exception { final Consumer consumer = mockConsumer(new KafkaException("blah")); final AbstractTask task = createTask(consumer); task.updateOffsetLimits(); } | protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } catch (final Auth... | AbstractTask { protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } ca... | AbstractTask { protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } ca... | AbstractTask { protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } ca... | AbstractTask { protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } ca... |
@Test(expected = WakeupException.class) public void shouldThrowWakeupExceptionOnInitializeOffsetsWhenWakeupException() throws Exception { final Consumer consumer = mockConsumer(new WakeupException()); final AbstractTask task = createTask(consumer); task.updateOffsetLimits(); } | protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } catch (final Auth... | AbstractTask { protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } ca... | AbstractTask { protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } ca... | AbstractTask { protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } ca... | AbstractTask { protected void updateOffsetLimits() { log.debug("{} Updating store offset limits {}", logPrefix); for (final TopicPartition partition : partitions) { try { final OffsetAndMetadata metadata = consumer.committed(partition); stateMgr.putOffsetLimit(partition, metadata != null ? metadata.offset() : 0L); } ca... |
@Test public void shouldNotAllowOffsetResetSourceWithoutTopics() { final TopologyBuilder builder = new TopologyBuilder(); final Serde<String> stringSerde = Serdes.String(); try { builder.addSource(TopologyBuilder.AutoOffsetReset.EARLIEST, "source", null, stringSerde.deserializer(), stringSerde.deserializer(), new Strin... | public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... |
@Test public void shouldNotAllowOffsetResetSourceWithDuplicateSourceName() { final TopologyBuilder builder = new TopologyBuilder(); final Serde<String> stringSerde = Serdes.String(); builder.addSource(TopologyBuilder.AutoOffsetReset.EARLIEST, "source", null, stringSerde.deserializer(), stringSerde.deserializer(), "topi... | public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... |
@Test(expected = BadRequestException.class) public void testPutConnectorConfigNameMismatch() throws Throwable { Map<String, String> connConfig = new HashMap<>(CONNECTOR_CONFIG); connConfig.put(ConnectorConfig.NAME_CONFIG, "mismatched-name"); connectorsResource.putConnectorConfig(CONNECTOR_NAME, FORWARD, connConfig); } | @PUT @Path("/{connector}/config") public Response putConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward, final Map<String, String> connectorConfig) throws Throwable { FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>(); String includedName ... | ConnectorsResource { @PUT @Path("/{connector}/config") public Response putConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward, final Map<String, String> connectorConfig) throws Throwable { FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>();... | ConnectorsResource { @PUT @Path("/{connector}/config") public Response putConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward, final Map<String, String> connectorConfig) throws Throwable { FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>();... | ConnectorsResource { @PUT @Path("/{connector}/config") public Response putConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward, final Map<String, String> connectorConfig) throws Throwable { FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>();... | ConnectorsResource { @PUT @Path("/{connector}/config") public Response putConnectorConfig(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward, final Map<String, String> connectorConfig) throws Throwable { FutureCallback<Herder.Created<ConnectorInfo>> cb = new FutureCallback<>();... |
@Test(expected = TopologyBuilderException.class) public void testAddSourceWithSameName() { final TopologyBuilder builder = new TopologyBuilder(); builder.addSource("source", "topic-1"); builder.addSource("source", "topic-2"); } | public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... |
@Test(expected = TopologyBuilderException.class) public void testAddSourceWithSameTopic() { final TopologyBuilder builder = new TopologyBuilder(); builder.addSource("source", "topic-1"); builder.addSource("source-2", "topic-1"); } | public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... |
@Test(expected = TopologyBuilderException.class) public void testAddProcessorWithWrongParent() { final TopologyBuilder builder = new TopologyBuilder(); builder.addProcessor("processor", new MockProcessorSupplier(), "source"); } | public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw new TopologyBuilderE... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... |
@Test(expected = TopologyBuilderException.class) public void testAddProcessorWithSelfParent() { final TopologyBuilder builder = new TopologyBuilder(); builder.addProcessor("processor", new MockProcessorSupplier(), "processor"); } | public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw new TopologyBuilderE... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... |
@Test(expected = TopologyBuilderException.class) public void testAddSinkWithWrongParent() { final TopologyBuilder builder = new TopologyBuilder(); builder.addSink("sink", "topic-2", "source"); } | public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } } | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final Topolog... | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final Topolog... |
@Test(expected = TopologyBuilderException.class) public void testAddSinkWithSelfParent() { final TopologyBuilder builder = new TopologyBuilder(); builder.addSink("sink", "topic-2", "sink"); } | public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } } | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final Topolog... | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final Topolog... |
@Test(expected = TopologyBuilderException.class) public void testPatternMatchesAlreadyProvidedTopicSource() { final TopologyBuilder builder = new TopologyBuilder(); builder.addSource("source-1", "foo"); builder.addSource("source-2", Pattern.compile("f.*")); } | public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... |
@Test(expected = TopologyBuilderException.class) public void testNamedTopicMatchesAlreadyProvidedPattern() { final TopologyBuilder builder = new TopologyBuilder(); builder.addSource("source-1", Pattern.compile("f.*")); builder.addSource("source-2", "foo"); } | public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... |
@Test(expected = TopologyBuilderException.class) public void testAddStateStoreWithNonExistingProcessor() { final TopologyBuilder builder = new TopologyBuilder(); builder.addStateStore(new MockStateStoreSupplier("store", false), "no-such-processsor"); } | public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name() + " is already ad... | TopologyBuilder { public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name()... | TopologyBuilder { public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name()... | TopologyBuilder { public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name()... | TopologyBuilder { public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name()... |
@Test(expected = TopologyBuilderException.class) public void testAddStateStoreWithDuplicates() { final TopologyBuilder builder = new TopologyBuilder(); builder.addStateStore(new MockStateStoreSupplier("store", false)); builder.addStateStore(new MockStateStoreSupplier("store", false)); } | public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name() + " is already ad... | TopologyBuilder { public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name()... | TopologyBuilder { public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name()... | TopologyBuilder { public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name()... | TopologyBuilder { public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name()... |
@Test public void testGetConnectorTaskConfigs() throws Throwable { final Capture<Callback<List<TaskInfo>>> cb = Capture.newInstance(); herder.taskConfigs(EasyMock.eq(CONNECTOR_NAME), EasyMock.capture(cb)); expectAndCallbackResult(cb, TASK_INFOS); PowerMock.replayAll(); List<TaskInfo> taskInfos = connectorsResource.getT... | @GET @Path("/{connector}/tasks") public List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<List<TaskInfo>> cb = new FutureCallback<>(); herder.taskConfigs(connector, cb); return completeOrForwardRequest(cb, "/conn... | ConnectorsResource { @GET @Path("/{connector}/tasks") public List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<List<TaskInfo>> cb = new FutureCallback<>(); herder.taskConfigs(connector, cb); return completeOrForw... | ConnectorsResource { @GET @Path("/{connector}/tasks") public List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<List<TaskInfo>> cb = new FutureCallback<>(); herder.taskConfigs(connector, cb); return completeOrForw... | ConnectorsResource { @GET @Path("/{connector}/tasks") public List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<List<TaskInfo>> cb = new FutureCallback<>(); herder.taskConfigs(connector, cb); return completeOrForw... | ConnectorsResource { @GET @Path("/{connector}/tasks") public List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<List<TaskInfo>> cb = new FutureCallback<>(); herder.taskConfigs(connector, cb); return completeOrForw... |
@Test public void testTopicGroups() { final TopologyBuilder builder = new TopologyBuilder(); builder.setApplicationId("X"); builder.addInternalTopic("topic-1x"); builder.addSource("source-1", "topic-1", "topic-1x"); builder.addSource("source-2", "topic-2"); builder.addSource("source-3", "topic-3"); builder.addSource("s... | public synchronized Map<Integer, TopicsInfo> topicGroups() { final Map<Integer, TopicsInfo> topicGroups = new LinkedHashMap<>(); if (nodeGroups == null) nodeGroups = makeNodeGroups(); for (Map.Entry<Integer, Set<String>> entry : nodeGroups.entrySet()) { final Set<String> sinkTopics = new HashSet<>(); final Set<String> ... | TopologyBuilder { public synchronized Map<Integer, TopicsInfo> topicGroups() { final Map<Integer, TopicsInfo> topicGroups = new LinkedHashMap<>(); if (nodeGroups == null) nodeGroups = makeNodeGroups(); for (Map.Entry<Integer, Set<String>> entry : nodeGroups.entrySet()) { final Set<String> sinkTopics = new HashSet<>(); ... | TopologyBuilder { public synchronized Map<Integer, TopicsInfo> topicGroups() { final Map<Integer, TopicsInfo> topicGroups = new LinkedHashMap<>(); if (nodeGroups == null) nodeGroups = makeNodeGroups(); for (Map.Entry<Integer, Set<String>> entry : nodeGroups.entrySet()) { final Set<String> sinkTopics = new HashSet<>(); ... | TopologyBuilder { public synchronized Map<Integer, TopicsInfo> topicGroups() { final Map<Integer, TopicsInfo> topicGroups = new LinkedHashMap<>(); if (nodeGroups == null) nodeGroups = makeNodeGroups(); for (Map.Entry<Integer, Set<String>> entry : nodeGroups.entrySet()) { final Set<String> sinkTopics = new HashSet<>(); ... | TopologyBuilder { public synchronized Map<Integer, TopicsInfo> topicGroups() { final Map<Integer, TopicsInfo> topicGroups = new LinkedHashMap<>(); if (nodeGroups == null) nodeGroups = makeNodeGroups(); for (Map.Entry<Integer, Set<String>> entry : nodeGroups.entrySet()) { final Set<String> sinkTopics = new HashSet<>(); ... |
@Test public void testBuild() { final TopologyBuilder builder = new TopologyBuilder(); builder.addSource("source-1", "topic-1", "topic-1x"); builder.addSource("source-2", "topic-2"); builder.addSource("source-3", "topic-3"); builder.addSource("source-4", "topic-4"); builder.addSource("source-5", "topic-5"); builder.add... | public synchronized ProcessorTopology build(final Integer topicGroupId) { Set<String> nodeGroup; if (topicGroupId != null) { nodeGroup = nodeGroups().get(topicGroupId); } else { final Set<String> globalNodeGroups = globalNodeGroups(); final Collection<Set<String>> values = nodeGroups().values(); nodeGroup = new HashSet... | TopologyBuilder { public synchronized ProcessorTopology build(final Integer topicGroupId) { Set<String> nodeGroup; if (topicGroupId != null) { nodeGroup = nodeGroups().get(topicGroupId); } else { final Set<String> globalNodeGroups = globalNodeGroups(); final Collection<Set<String>> values = nodeGroups().values(); nodeG... | TopologyBuilder { public synchronized ProcessorTopology build(final Integer topicGroupId) { Set<String> nodeGroup; if (topicGroupId != null) { nodeGroup = nodeGroups().get(topicGroupId); } else { final Set<String> globalNodeGroups = globalNodeGroups(); final Collection<Set<String>> values = nodeGroups().values(); nodeG... | TopologyBuilder { public synchronized ProcessorTopology build(final Integer topicGroupId) { Set<String> nodeGroup; if (topicGroupId != null) { nodeGroup = nodeGroups().get(topicGroupId); } else { final Set<String> globalNodeGroups = globalNodeGroups(); final Collection<Set<String>> values = nodeGroups().values(); nodeG... | TopologyBuilder { public synchronized ProcessorTopology build(final Integer topicGroupId) { Set<String> nodeGroup; if (topicGroupId != null) { nodeGroup = nodeGroups().get(topicGroupId); } else { final Set<String> globalNodeGroups = globalNodeGroups(); final Collection<Set<String>> values = nodeGroups().values(); nodeG... |
@Test(expected = NullPointerException.class) public void shouldNotAllowNullNameWhenAddingSink() throws Exception { final TopologyBuilder builder = new TopologyBuilder(); builder.addSink(null, "topic"); } | public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } } | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final Topolog... | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final Topolog... |
@Test(expected = NullPointerException.class) public void shouldNotAllowNullTopicWhenAddingSink() throws Exception { final TopologyBuilder builder = new TopologyBuilder(); builder.addSink("name", null); } | public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } } | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final Topolog... | TopologyBuilder { public synchronized final TopologyBuilder addSink(final String name, final String topic, final String... parentNames) { return addSink(name, topic, null, null, parentNames); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final Topolog... |
@Test(expected = NullPointerException.class) public void shouldNotAllowNullNameWhenAddingProcessor() throws Exception { final TopologyBuilder builder = new TopologyBuilder(); builder.addProcessor(null, new ProcessorSupplier() { @Override public Processor get() { return null; } }); } | public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw new TopologyBuilderE... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... |
@Test(expected = NullPointerException.class) public void shouldNotAllowNullProcessorSupplier() throws Exception { final TopologyBuilder builder = new TopologyBuilder(); builder.addProcessor("name", null); } | public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw new TopologyBuilderE... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... | TopologyBuilder { public synchronized final TopologyBuilder addProcessor(final String name, final ProcessorSupplier supplier, final String... parentNames) { Objects.requireNonNull(name, "name must not be null"); Objects.requireNonNull(supplier, "supplier must not be null"); if (nodeFactories.containsKey(name)) throw ne... |
@Test(expected = NullPointerException.class) public void shouldNotAllowNullNameWhenAddingSource() throws Exception { final TopologyBuilder builder = new TopologyBuilder(); builder.addSource(null, Pattern.compile(".*")); } | public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... | TopologyBuilder { public synchronized final TopologyBuilder addSource(final String name, final String... topics) { return addSource(null, name, null, null, null, topics); } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); synchronized final TopologyBuilder addSource(fi... |
@Test(expected = NullPointerException.class) public void shouldNotAllowNullProcessorNameWhenConnectingProcessorAndStateStores() throws Exception { final TopologyBuilder builder = new TopologyBuilder(); builder.connectProcessorAndStateStores(null, "store"); } | public synchronized final TopologyBuilder connectProcessorAndStateStores(final String processorName, final String... stateStoreNames) { Objects.requireNonNull(processorName, "processorName can't be null"); if (stateStoreNames != null) { for (String stateStoreName : stateStoreNames) { connectProcessorAndStateStore(proce... | TopologyBuilder { public synchronized final TopologyBuilder connectProcessorAndStateStores(final String processorName, final String... stateStoreNames) { Objects.requireNonNull(processorName, "processorName can't be null"); if (stateStoreNames != null) { for (String stateStoreName : stateStoreNames) { connectProcessorA... | TopologyBuilder { public synchronized final TopologyBuilder connectProcessorAndStateStores(final String processorName, final String... stateStoreNames) { Objects.requireNonNull(processorName, "processorName can't be null"); if (stateStoreNames != null) { for (String stateStoreName : stateStoreNames) { connectProcessorA... | TopologyBuilder { public synchronized final TopologyBuilder connectProcessorAndStateStores(final String processorName, final String... stateStoreNames) { Objects.requireNonNull(processorName, "processorName can't be null"); if (stateStoreNames != null) { for (String stateStoreName : stateStoreNames) { connectProcessorA... | TopologyBuilder { public synchronized final TopologyBuilder connectProcessorAndStateStores(final String processorName, final String... stateStoreNames) { Objects.requireNonNull(processorName, "processorName can't be null"); if (stateStoreNames != null) { for (String stateStoreName : stateStoreNames) { connectProcessorA... |
@Test(expected = NullPointerException.class) public void shouldNotAddNullInternalTopic() throws Exception { final TopologyBuilder builder = new TopologyBuilder(); builder.addInternalTopic(null); } | public synchronized final TopologyBuilder addInternalTopic(final String topicName) { Objects.requireNonNull(topicName, "topicName can't be null"); this.internalTopicNames.add(topicName); return this; } | TopologyBuilder { public synchronized final TopologyBuilder addInternalTopic(final String topicName) { Objects.requireNonNull(topicName, "topicName can't be null"); this.internalTopicNames.add(topicName); return this; } } | TopologyBuilder { public synchronized final TopologyBuilder addInternalTopic(final String topicName) { Objects.requireNonNull(topicName, "topicName can't be null"); this.internalTopicNames.add(topicName); return this; } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder addInternalTopic(final String topicName) { Objects.requireNonNull(topicName, "topicName can't be null"); this.internalTopicNames.add(topicName); return this; } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); ... | TopologyBuilder { public synchronized final TopologyBuilder addInternalTopic(final String topicName) { Objects.requireNonNull(topicName, "topicName can't be null"); this.internalTopicNames.add(topicName); return this; } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicationId); ... |
@Test(expected = NullPointerException.class) public void shouldNotSetApplicationIdToNull() throws Exception { final TopologyBuilder builder = new TopologyBuilder(); builder.setApplicationId(null); } | public synchronized final TopologyBuilder setApplicationId(final String applicationId) { Objects.requireNonNull(applicationId, "applicationId can't be null"); this.applicationId = applicationId; return this; } | TopologyBuilder { public synchronized final TopologyBuilder setApplicationId(final String applicationId) { Objects.requireNonNull(applicationId, "applicationId can't be null"); this.applicationId = applicationId; return this; } } | TopologyBuilder { public synchronized final TopologyBuilder setApplicationId(final String applicationId) { Objects.requireNonNull(applicationId, "applicationId can't be null"); this.applicationId = applicationId; return this; } TopologyBuilder(); } | TopologyBuilder { public synchronized final TopologyBuilder setApplicationId(final String applicationId) { Objects.requireNonNull(applicationId, "applicationId can't be null"); this.applicationId = applicationId; return this; } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicat... | TopologyBuilder { public synchronized final TopologyBuilder setApplicationId(final String applicationId) { Objects.requireNonNull(applicationId, "applicationId can't be null"); this.applicationId = applicationId; return this; } TopologyBuilder(); synchronized final TopologyBuilder setApplicationId(final String applicat... |
@Test(expected = NotFoundException.class) public void testGetConnectorTaskConfigsConnectorNotFound() throws Throwable { final Capture<Callback<List<TaskInfo>>> cb = Capture.newInstance(); herder.taskConfigs(EasyMock.eq(CONNECTOR_NAME), EasyMock.capture(cb)); expectAndCallbackException(cb, new NotFoundException("connect... | @GET @Path("/{connector}/tasks") public List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<List<TaskInfo>> cb = new FutureCallback<>(); herder.taskConfigs(connector, cb); return completeOrForwardRequest(cb, "/conn... | ConnectorsResource { @GET @Path("/{connector}/tasks") public List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<List<TaskInfo>> cb = new FutureCallback<>(); herder.taskConfigs(connector, cb); return completeOrForw... | ConnectorsResource { @GET @Path("/{connector}/tasks") public List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<List<TaskInfo>> cb = new FutureCallback<>(); herder.taskConfigs(connector, cb); return completeOrForw... | ConnectorsResource { @GET @Path("/{connector}/tasks") public List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<List<TaskInfo>> cb = new FutureCallback<>(); herder.taskConfigs(connector, cb); return completeOrForw... | ConnectorsResource { @GET @Path("/{connector}/tasks") public List<TaskInfo> getTaskConfigs(final @PathParam("connector") String connector, final @QueryParam("forward") Boolean forward) throws Throwable { FutureCallback<List<TaskInfo>> cb = new FutureCallback<>(); herder.taskConfigs(connector, cb); return completeOrForw... |
@Test(expected = NullPointerException.class) public void shouldNotAddNullStateStoreSupplier() throws Exception { final TopologyBuilder builder = new TopologyBuilder(); builder.addStateStore(null); } | public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name() + " is already ad... | TopologyBuilder { public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name()... | TopologyBuilder { public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name()... | TopologyBuilder { public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name()... | TopologyBuilder { public synchronized final TopologyBuilder addStateStore(final StateStoreSupplier supplier, final String... processorNames) { Objects.requireNonNull(supplier, "supplier can't be null"); if (stateFactories.containsKey(supplier.name())) { throw new TopologyBuilderException("StateStore " + supplier.name()... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.