congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
CoordinatorStreamUtil.getCoordinatorSystemStream
Code IndexAdd Tabnine to your IDE (free)

How to use
getCoordinatorSystemStream
method
in
org.apache.samza.util.CoordinatorStreamUtil

Best Java code snippets using org.apache.samza.util.CoordinatorStreamUtil.getCoordinatorSystemStream (Showing top 20 results out of 315)

origin: apache/samza

/**
 * Creates a coordinator stream kafka topic.
 */
private void createCoordinatorStream() {
 SystemAdmin coordinatorSystemAdmin = null;
 SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 coordinatorSystemAdmin = systemAdmins.getSystemAdmin(coordinatorSystemStream.getSystem());
 String streamName = coordinatorSystemStream.getStream();
 StreamSpec coordinatorSpec = StreamSpec.createCoordinatorStreamSpec(streamName, coordinatorSystemStream.getSystem());
 if (coordinatorSystemAdmin.createStream(coordinatorSpec)) {
  LOG.info("Created coordinator stream: {}.", streamName);
 } else {
  LOG.info("Coordinator stream: {} already exists.", streamName);
 }
}
origin: apache/samza

public CoordinatorStreamSystemProducer(Config config, MetricsRegistry registry) {
 SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 SystemAdmin systemAdmin = systemFactory.getAdmin(coordinatorSystemStream.getSystem(), config);
 SystemProducer systemProducer = systemFactory.getProducer(coordinatorSystemStream.getSystem(), config, registry);
 this.systemStream = coordinatorSystemStream;
 this.systemProducer = systemProducer;
 this.systemAdmin = systemAdmin;
 this.keySerde = new JsonSerde<>();
 this.messageSerde = new JsonSerde<>();
}
origin: org.apache.samza/samza-core_2.11

public CoordinatorStreamSystemProducer(Config config, MetricsRegistry registry) {
 SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 SystemAdmin systemAdmin = systemFactory.getAdmin(coordinatorSystemStream.getSystem(), config);
 SystemProducer systemProducer = systemFactory.getProducer(coordinatorSystemStream.getSystem(), config, registry);
 this.systemStream = coordinatorSystemStream;
 this.systemProducer = systemProducer;
 this.systemAdmin = systemAdmin;
 this.keySerde = new JsonSerde<>();
 this.messageSerde = new JsonSerde<>();
}
origin: org.apache.samza/samza-core_2.10

public CoordinatorStreamSystemProducer(Config config, MetricsRegistry registry) {
 SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 SystemAdmin systemAdmin = systemFactory.getAdmin(coordinatorSystemStream.getSystem(), config);
 SystemProducer systemProducer = systemFactory.getProducer(coordinatorSystemStream.getSystem(), config, registry);
 this.systemStream = coordinatorSystemStream;
 this.systemProducer = systemProducer;
 this.systemAdmin = systemAdmin;
 this.keySerde = new JsonSerde<>();
 this.messageSerde = new JsonSerde<>();
}
origin: apache/samza

@Before
public void setup() {
 mockCoordinatorStreamSystemFactory = new MockCoordinatorStreamSystemFactory();
 MockCoordinatorStreamSystemFactory.enableMockConsumerCache();
 PowerMockito.mockStatic(CoordinatorStreamUtil.class);
 when(CoordinatorStreamUtil.getCoordinatorSystemFactory(anyObject())).thenReturn(mockCoordinatorStreamSystemFactory);
 when(CoordinatorStreamUtil.getCoordinatorSystemStream(anyObject())).thenReturn(new SystemStream("test-kafka", "test"));
 when(CoordinatorStreamUtil.getCoordinatorStreamName(anyObject(), anyObject())).thenReturn("test");
}
origin: org.apache.samza/samza-core_2.12

public CoordinatorStreamSystemProducer(Config config, MetricsRegistry registry) {
 SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 SystemAdmin systemAdmin = systemFactory.getAdmin(coordinatorSystemStream.getSystem(), config);
 SystemProducer systemProducer = systemFactory.getProducer(coordinatorSystemStream.getSystem(), config, registry);
 this.systemStream = coordinatorSystemStream;
 this.systemProducer = systemProducer;
 this.systemAdmin = systemAdmin;
 this.keySerde = new JsonSerde<>();
 this.messageSerde = new JsonSerde<>();
}
origin: org.apache.samza/samza-core

public CoordinatorStreamSystemProducer(Config config, MetricsRegistry registry) {
 SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 SystemAdmin systemAdmin = systemFactory.getAdmin(coordinatorSystemStream.getSystem(), config);
 SystemProducer systemProducer = systemFactory.getProducer(coordinatorSystemStream.getSystem(), config, registry);
 this.systemStream = coordinatorSystemStream;
 this.systemProducer = systemProducer;
 this.systemAdmin = systemAdmin;
 this.keySerde = new JsonSerde<>();
 this.messageSerde = new JsonSerde<>();
}
origin: apache/samza

public CoordinatorStreamSystemConsumer(Config config, MetricsRegistry registry) {
 SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 SystemAdmin systemAdmin = systemFactory.getAdmin(coordinatorSystemStream.getSystem(), config);
 SystemConsumer systemConsumer = systemFactory.getConsumer(coordinatorSystemStream.getSystem(), config, registry);
 this.coordinatorSystemStreamPartition = new SystemStreamPartition(coordinatorSystemStream, new Partition(0));
 this.systemConsumer = systemConsumer;
 this.systemAdmin = systemAdmin;
 this.configMap = new HashMap<>();
 this.isBootstrapped = false;
 this.keySerde = new JsonSerde<>();
 this.messageSerde = new JsonSerde<>();
}
origin: org.apache.samza/samza-core_2.11

public CoordinatorStreamSystemConsumer(Config config, MetricsRegistry registry) {
 SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 SystemAdmin systemAdmin = systemFactory.getAdmin(coordinatorSystemStream.getSystem(), config);
 SystemConsumer systemConsumer = systemFactory.getConsumer(coordinatorSystemStream.getSystem(), config, registry);
 this.coordinatorSystemStreamPartition = new SystemStreamPartition(coordinatorSystemStream, new Partition(0));
 this.systemConsumer = systemConsumer;
 this.systemAdmin = systemAdmin;
 this.configMap = new HashMap<>();
 this.isBootstrapped = false;
 this.keySerde = new JsonSerde<>();
 this.messageSerde = new JsonSerde<>();
}
origin: apache/samza

@Before
public void setUp() throws NoSuchFieldException, NoSuchMethodException {
 configMap = new HashMap<>();
 configMap.put("job.name", "test-job");
 configMap.put("job.coordinator.system", "kafka");
 configMap.put("task.inputs", "kafka.topic1");
 configMap.put("systems.kafka.samza.factory", "org.apache.samza.system.MockSystemFactory");
 configMap.put("samza.cluster-manager.factory", "org.apache.samza.clustermanager.MockClusterResourceManagerFactory");
 configMap.put("job.coordinator.monitor-partition-change.frequency.ms", "1");
 MockSystemFactory.MSG_QUEUES.put(new SystemStreamPartition("kafka", "topic1", new Partition(0)), new ArrayList<>());
 MockSystemFactory.MSG_QUEUES.put(new SystemStreamPartition("kafka", "__samza_coordinator_test-job_1", new Partition(0)), new ArrayList<>());
 MockCoordinatorStreamSystemFactory.enableMockConsumerCache();
 PowerMockito.mockStatic(CoordinatorStreamUtil.class);
 when(CoordinatorStreamUtil.getCoordinatorSystemFactory(anyObject())).thenReturn(new MockCoordinatorStreamSystemFactory());
 when(CoordinatorStreamUtil.getCoordinatorSystemStream(anyObject())).thenReturn(new SystemStream("kafka", "test"));
 when(CoordinatorStreamUtil.getCoordinatorStreamName(anyObject(), anyObject())).thenReturn("test");
}
origin: org.apache.samza/samza-core_2.10

public CoordinatorStreamSystemConsumer(Config config, MetricsRegistry registry) {
 SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 SystemAdmin systemAdmin = systemFactory.getAdmin(coordinatorSystemStream.getSystem(), config);
 SystemConsumer systemConsumer = systemFactory.getConsumer(coordinatorSystemStream.getSystem(), config, registry);
 this.coordinatorSystemStreamPartition = new SystemStreamPartition(coordinatorSystemStream, new Partition(0));
 this.systemConsumer = systemConsumer;
 this.systemAdmin = systemAdmin;
 this.configMap = new HashMap<>();
 this.isBootstrapped = false;
 this.keySerde = new JsonSerde<>();
 this.messageSerde = new JsonSerde<>();
}
origin: org.apache.samza/samza-core

public CoordinatorStreamSystemConsumer(Config config, MetricsRegistry registry) {
 SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 SystemAdmin systemAdmin = systemFactory.getAdmin(coordinatorSystemStream.getSystem(), config);
 SystemConsumer systemConsumer = systemFactory.getConsumer(coordinatorSystemStream.getSystem(), config, registry);
 this.coordinatorSystemStreamPartition = new SystemStreamPartition(coordinatorSystemStream, new Partition(0));
 this.systemConsumer = systemConsumer;
 this.systemAdmin = systemAdmin;
 this.configMap = new HashMap<>();
 this.isBootstrapped = false;
 this.keySerde = new JsonSerde<>();
 this.messageSerde = new JsonSerde<>();
}
origin: org.apache.samza/samza-core_2.12

public CoordinatorStreamSystemConsumer(Config config, MetricsRegistry registry) {
 SystemStream coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 SystemAdmin systemAdmin = systemFactory.getAdmin(coordinatorSystemStream.getSystem(), config);
 SystemConsumer systemConsumer = systemFactory.getConsumer(coordinatorSystemStream.getSystem(), config, registry);
 this.coordinatorSystemStreamPartition = new SystemStreamPartition(coordinatorSystemStream, new Partition(0));
 this.systemConsumer = systemConsumer;
 this.systemAdmin = systemAdmin;
 this.configMap = new HashMap<>();
 this.isBootstrapped = false;
 this.keySerde = new JsonSerde<>();
 this.messageSerde = new JsonSerde<>();
}
origin: apache/samza

@Before
public void setup() {
 MockCoordinatorStreamSystemFactory.enableMockConsumerCache();
 mockCoordinatorStreamSystemFactory = new MockCoordinatorStreamSystemFactory();
 PowerMockito.mockStatic(CoordinatorStreamUtil.class);
 when(CoordinatorStreamUtil.getCoordinatorSystemFactory(anyObject())).thenReturn(mockCoordinatorStreamSystemFactory);
 when(CoordinatorStreamUtil.getCoordinatorSystemStream(anyObject())).thenReturn(new SystemStream("test-kafka", "test"));
 when(CoordinatorStreamUtil.getCoordinatorStreamName(anyObject(), anyObject())).thenReturn("test");
}
origin: apache/samza

@Before
public void setUp() {
 MockCoordinatorStreamSystemFactory.enableMockConsumerCache();
 Map<String, String> configMap = ImmutableMap.of("job.name", "test-job",
                         "job.coordinator.system", "test-kafka");
 MockCoordinatorStreamSystemFactory systemFactory = new MockCoordinatorStreamSystemFactory();
 PowerMockito.mockStatic(CoordinatorStreamUtil.class);
 when(CoordinatorStreamUtil.getCoordinatorSystemFactory(anyObject())).thenReturn(systemFactory);
 when(CoordinatorStreamUtil.getCoordinatorSystemStream(anyObject())).thenReturn(new SystemStream("test-kafka", "test"));
 when(CoordinatorStreamUtil.getCoordinatorStreamName(anyObject(), anyObject())).thenReturn("test");
 coordinatorStreamStore = new CoordinatorStreamStore(SetTaskContainerMapping.TYPE, new MapConfig(configMap), new MetricsRegistryMap());
 coordinatorStreamStore.init();
}
origin: apache/samza

public CoordinatorStreamStore(String namespace, Config config, MetricsRegistry metricsRegistry) {
 this.config = config;
 this.type = namespace;
 this.keySerde = new CoordinatorStreamKeySerde(type);
 this.coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 this.coordinatorSystemStreamPartition = new SystemStreamPartition(coordinatorSystemStream, new Partition(0));
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 this.systemProducer = systemFactory.getProducer(this.coordinatorSystemStream.getSystem(), config, metricsRegistry);
 this.systemConsumer = systemFactory.getConsumer(this.coordinatorSystemStream.getSystem(), config, metricsRegistry);
 this.systemAdmin = systemFactory.getAdmin(this.coordinatorSystemStream.getSystem(), config);
}
origin: org.apache.samza/samza-core_2.11

public CoordinatorStreamStore(String namespace, Config config, MetricsRegistry metricsRegistry) {
 this.config = config;
 this.type = namespace;
 this.keySerde = new JsonSerde<>();
 this.coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 this.coordinatorSystemStreamPartition = new SystemStreamPartition(coordinatorSystemStream, new Partition(0));
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 this.systemProducer = systemFactory.getProducer(this.coordinatorSystemStream.getSystem(), config, metricsRegistry);
 this.systemConsumer = systemFactory.getConsumer(this.coordinatorSystemStream.getSystem(), config, metricsRegistry);
 this.systemAdmin = systemFactory.getAdmin(this.coordinatorSystemStream.getSystem(), config);
}
origin: org.apache.samza/samza-core_2.10

public CoordinatorStreamStore(String namespace, Config config, MetricsRegistry metricsRegistry) {
 this.config = config;
 this.type = namespace;
 this.keySerde = new JsonSerde<>();
 this.coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 this.coordinatorSystemStreamPartition = new SystemStreamPartition(coordinatorSystemStream, new Partition(0));
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 this.systemProducer = systemFactory.getProducer(this.coordinatorSystemStream.getSystem(), config, metricsRegistry);
 this.systemConsumer = systemFactory.getConsumer(this.coordinatorSystemStream.getSystem(), config, metricsRegistry);
 this.systemAdmin = systemFactory.getAdmin(this.coordinatorSystemStream.getSystem(), config);
}
origin: org.apache.samza/samza-core

public CoordinatorStreamStore(String namespace, Config config, MetricsRegistry metricsRegistry) {
 this.config = config;
 this.type = namespace;
 this.keySerde = new JsonSerde<>();
 this.coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 this.coordinatorSystemStreamPartition = new SystemStreamPartition(coordinatorSystemStream, new Partition(0));
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 this.systemProducer = systemFactory.getProducer(this.coordinatorSystemStream.getSystem(), config, metricsRegistry);
 this.systemConsumer = systemFactory.getConsumer(this.coordinatorSystemStream.getSystem(), config, metricsRegistry);
 this.systemAdmin = systemFactory.getAdmin(this.coordinatorSystemStream.getSystem(), config);
}
origin: org.apache.samza/samza-core_2.12

public CoordinatorStreamStore(String namespace, Config config, MetricsRegistry metricsRegistry) {
 this.config = config;
 this.type = namespace;
 this.keySerde = new JsonSerde<>();
 this.coordinatorSystemStream = CoordinatorStreamUtil.getCoordinatorSystemStream(config);
 this.coordinatorSystemStreamPartition = new SystemStreamPartition(coordinatorSystemStream, new Partition(0));
 SystemFactory systemFactory = CoordinatorStreamUtil.getCoordinatorSystemFactory(config);
 this.systemProducer = systemFactory.getProducer(this.coordinatorSystemStream.getSystem(), config, metricsRegistry);
 this.systemConsumer = systemFactory.getConsumer(this.coordinatorSystemStream.getSystem(), config, metricsRegistry);
 this.systemAdmin = systemFactory.getAdmin(this.coordinatorSystemStream.getSystem(), config);
}
org.apache.samza.utilCoordinatorStreamUtilgetCoordinatorSystemStream

Popular methods of CoordinatorStreamUtil

  • getCoordinatorSystemFactory
  • buildCoordinatorStreamConfig
  • getCoordinatorStreamName

Popular in Java

  • Finding current android device location
  • scheduleAtFixedRate (Timer)
  • getContentResolver (Context)
  • addToBackStack (FragmentTransaction)
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now