Tabnine Logo
GlobalStreamId.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.apache.storm.generated.GlobalStreamId
constructor

Best Java code snippets using org.apache.storm.generated.GlobalStreamId.<init> (Showing top 20 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew ArrayList()
  • Codota Iconnew LinkedList()
  • Smart code suggestions by Tabnine
}
origin: apache/storm

public static GlobalStreamId getGlobalStreamId(String streamId, String componentId) {
  if (componentId == null) {
    return new GlobalStreamId(streamId, DEFAULT_STREAM_ID);
  }
  return new GlobalStreamId(streamId, componentId);
}
origin: apache/storm

/**
 * Get the global stream id for this input stream.
 * @return the GlobalStreamId for this input stream.
 */
public synchronized GlobalStreamId gsid() {
  if (gsid == null) {
    gsid = new GlobalStreamId(fromComponent, id);
  }
  return gsid;
}
origin: apache/storm

protected IdStreamSpec(String component, String stream) {
  _id = new GlobalStreamId(component, stream);
}
origin: apache/storm

public GlobalStreamId deepCopy() {
 return new GlobalStreamId(this);
}
origin: apache/storm

  @Override
  public GlobalStreamId transform(Object key) {
    if (key instanceof List) {
      List l = (List) key;
      if (l.size() > 1) {
        return new GlobalStreamId((String) l.get(0), (String) l.get(1));
      }
    }
    return new GlobalStreamId("", key.toString());
  }
}
origin: apache/storm

private static GlobalStreamId toGlobalStreamId(List list) {
  return new GlobalStreamId((String) list.get(0), (String) list.get(1));
}
origin: apache/storm

private void markBatchGroups(String component, Map<String, String> batchGroups) {
  for (Map.Entry<String, String> entry : batchGroups.entrySet()) {
    batchIds.put(new GlobalStreamId(component, entry.getKey()), entry.getValue());
  }
}
origin: apache/storm

  @Override
  public GlobalStreamId getSourceGlobalStreamId() {
    return new GlobalStreamId("s1", "default");
  }
};
origin: apache/storm

@Override
public GlobalStreamId getSourceGlobalStreamId() {
  return new GlobalStreamId(getSourceComponent(), streamId);
}
origin: apache/storm

private BoltDeclarer grouping(String componentId, String streamId, Grouping grouping) {
  commons.get(_boltId).put_to_inputs(new GlobalStreamId(componentId, streamId), grouping);
  return this;
}
origin: apache/storm

List<GlobalStreamId> getBoltSubscriptionStreams(String id) {
  List<GlobalStreamId> ret = new ArrayList<>();
  Component c = bolts.get(id);
  for (InputDeclaration d : c.declarations) {
    ret.add(new GlobalStreamId(d.getComponent(), d.getStream()));
  }
  return ret;
}
origin: apache/storm

public OutputStream remap(String origId, Map<GlobalStreamId, GlobalStreamId> remappedStreams) {
  GlobalStreamId remapped = remappedStreams.get(new GlobalStreamId(origId, id));
  return new OutputStream(remapped.get_streamId(), rate, areKeysSkewed);
}
origin: apache/storm

private TopologyContext getTopologyContext() {
  TopologyContext context = Mockito.mock(TopologyContext.class);
  Map<GlobalStreamId, Grouping> sources = Collections.singletonMap(
    new GlobalStreamId("s1", "default"),
    null
  );
  Mockito.when(context.getThisSources()).thenReturn(sources);
  return context;
}
origin: apache/storm

private Tuple getTuple(String streamId, final Fields fields, Values values, String srcComponent) {
  return new TupleImpl(getContext(fields), values, srcComponent, 1, streamId) {
    @Override
    public GlobalStreamId getSourceGlobalStreamId() {
      return new GlobalStreamId("s1", "default");
    }
  };
}
origin: apache/storm

  private List<Tuple> getMockTuples(int count) {
    List<Tuple> mockTuples = new ArrayList<>();
    for (long i = 0; i < count; i++) {
      Tuple mockTuple = Mockito.mock(Tuple.class);
      Mockito.when(mockTuple.getLongByField("msgid")).thenReturn(i);
      Mockito.when(mockTuple.getSourceTask()).thenReturn(1);
      Mockito.when(mockTuple.getSourceGlobalStreamId()).thenReturn(new GlobalStreamId("a", "s"));
      mockTuples.add(mockTuple);
    }
    return mockTuples;
  }
}
origin: apache/storm

@Test
public void testSpoutToBolt() throws Exception {
  Stream<Tuple> stream = streamBuilder.newStream(newSpout(Utils.DEFAULT_STREAM_ID));
  stream.to(newBolt());
  StormTopology topology = streamBuilder.build();
  assertEquals(1, topology.get_spouts_size());
  assertEquals(1, topology.get_bolts_size());
  String spoutId = topology.get_spouts().keySet().iterator().next();
  Map<GlobalStreamId, Grouping> expected = new HashMap<>();
  expected.put(new GlobalStreamId(spoutId, "default"), Grouping.shuffle(new NullStruct()));
  assertEquals(expected, topology.get_bolts().values().iterator().next().get_common().get_inputs());
}
origin: apache/storm

  @Test
  public void testEmptyState() throws IOException {
    TmpPath tmp_dir = new TmpPath();
    String dir = tmp_dir.getPath();
    LocalState ls = new LocalState(dir, true);
    GlobalStreamId gs_a = new GlobalStreamId("a", "a");
    FileOutputStream data = FileUtils.openOutputStream(new File(dir, "12345"));
    FileOutputStream version = FileUtils.openOutputStream(new File(dir, "12345.version"));
    Assert.assertNull(ls.get("c"));
    ls.put("a", gs_a);
    Assert.assertEquals(gs_a, ls.get("a"));

  }
}
origin: apache/storm

@Test
public void testDeserialize_readingFromGzip() throws Exception {
  GlobalStreamId id = new GlobalStreamId("first", "second");
  byte[] serialized = new GzipThriftSerializationDelegate().serialize(id);
  GlobalStreamId id2 = testDelegate.deserialize(serialized, GlobalStreamId.class);
  assertEquals(id2.get_componentId(), id.get_componentId());
  assertEquals(id2.get_streamId(), id.get_streamId());
}
origin: apache/storm

@Test
public void testDeserialize_readingFromGzipBridge() throws Exception {
  GlobalStreamId id = new GlobalStreamId("first", "second");
  byte[] serialized = new GzipBridgeThriftSerializationDelegate().serialize(id);
  GlobalStreamId id2 = testDelegate.deserialize(serialized, GlobalStreamId.class);
  assertEquals(id2.get_componentId(), id.get_componentId());
  assertEquals(id2.get_streamId(), id.get_streamId());
}
origin: apache/storm

  @Test
  public void testDeserialize_readingFromDefault() throws Exception {
    GlobalStreamId id = new GlobalStreamId("A", "B");

    byte[] serialized = new ThriftSerializationDelegate().serialize(id);

    GlobalStreamId id2 = testDelegate.deserialize(serialized, GlobalStreamId.class);

    assertEquals(id2.get_componentId(), id.get_componentId());
    assertEquals(id2.get_streamId(), id.get_streamId());
  }
}
org.apache.storm.generatedGlobalStreamId<init>

Javadoc

Performs a deep copy on other.

Popular methods of GlobalStreamId

  • get_componentId
  • get_streamId
  • equals
  • hashCode
  • is_set_componentId
    Returns true if field componentId is set (has been assigned a value) and false otherwise
  • is_set_streamId
    Returns true if field streamId is set (has been assigned a value) and false otherwise
  • read
  • set_componentId
  • set_componentId_isSet
  • set_streamId
  • set_streamId_isSet
  • toString
  • set_streamId_isSet,
  • toString,
  • unset_componentId,
  • unset_streamId,
  • validate,
  • write,
  • scheme

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • onRequestPermissionsResult (Fragment)
  • Rectangle (java.awt)
    A Rectangle specifies an area in a coordinate space that is enclosed by the Rectangle object's top-
  • BitSet (java.util)
    The BitSet class implements abit array [http://en.wikipedia.org/wiki/Bit_array]. Each element is eit
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • JPanel (javax.swing)
  • 21 Best Atom Packages for 2021
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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