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

How to use
getBoltId
method
in
org.apache.eagle.alert.coordination.model.WorkSlot

Best Java code snippets using org.apache.eagle.alert.coordination.model.WorkSlot.getBoltId (Showing top 12 results out of 315)

origin: apache/eagle

private String getUniqueBoltId(WorkSlot slot) {
  return String.format(UNIQUE_BOLT_ID, slot.getTopologyName(), slot.getBoltId());
}
origin: apache/eagle

/**
 * in correlation cases, multiple streams will go to the same queue for correlation policy.
 *
 * @param spec
 */
private void sanityCheck(RouterSpec spec) {
  Set<String> totalRequestedSlots = new HashSet<>();
  for (StreamRouterSpec s : spec.getRouterSpecs()) {
    for (PolicyWorkerQueue q : s.getTargetQueue()) {
      List<String> workers = new ArrayList<>();
      q.getWorkers().forEach(w -> workers.add(w.getBoltId()));
      totalRequestedSlots.addAll(workers);
    }
  }
  if (totalRequestedSlots.size() > getOutputStreamIds().size()) {
    String error = String.format("Requested slots are not consistent with provided slots, %s, %s", totalRequestedSlots, getOutputStreamIds());
    LOG.error(error);
    throw new IllegalStateException(error);
  }
}
origin: apache/eagle

private void placePolicyToQueue(PolicyDefinition def, StreamWorkSlotQueue queue,
                Map<String, PolicyAssignment> newAssignments) {
  for (WorkSlot slot : queue.getWorkingSlots()) {
    Topology targetTopology = context.getTopologies().get(slot.getTopologyName());
    TopologyUsage usage = context.getTopologyUsages().get(slot.getTopologyName());
    AlertBoltUsage alertBoltUsage = usage.getAlertBoltUsage(slot.getBoltId());
    placePolicy(def, alertBoltUsage, targetTopology, usage);
  }
  // queue.placePolicy(def);
  PolicyAssignment assignment = new PolicyAssignment(def.getName(), queue.getQueueId());
  context.getPolicyAssignments().put(def.getName(), assignment);
  newAssignments.put(def.getName(), assignment);
}
origin: apache/eagle

private void assignQueueSlots(MonitoredStream stream, StreamWorkSlotQueue queue) {
  for (WorkSlot slot : queue.getWorkingSlots()) {
    TopologyUsage u = context.getTopologyUsages().get(slot.getTopologyName());
    AlertBoltUsage boltUsage = u.getAlertBoltUsage(slot.getBoltId());
    boltUsage.addQueue(stream.getStreamGroup(), queue);
    u.addMonitoredStream(stream);
  }
}
origin: apache/eagle

private boolean isQueueAvailable(StreamWorkSlotQueue queue, PolicyDefinition def) {
  if (queue.getQueueSize() < def.getParallelismHint()) {
    return false;
  }
  for (WorkSlot slot : queue.getWorkingSlots()) {
    TopologyUsage u = context.getTopologyUsages().get(slot.getTopologyName());
    AlertBoltUsage usage = u.getAlertBoltUsage(slot.getBoltId());
    if (!isBoltAvailable(usage, def)) {
      return false;
    }
  }
  return true;
}
origin: apache/eagle

  group1Slots.add(slot.getBoltId());
});
Assert.assertEquals(2, getMonitorStream(usage.getMonitoredStream()).get(group2).getQueues().get(0).getWorkingSlots().size());
getMonitorStream(usage.getMonitoredStream()).get(group2).getQueues().get(0).getWorkingSlots().forEach(slot -> {
  Assert.assertTrue(!group1Slots.contains(slot.getBoltId()));
});
Assert.assertEquals(2, getMonitorStream(usage.getMonitoredStream()).get(group3).getQueues().get(0).getWorkingSlots().size());
getMonitorStream(usage.getMonitoredStream()).get(group3).getQueues().get(0).getWorkingSlots().forEach(slot -> {
  Assert.assertTrue(!group1Slots.contains(slot.getBoltId()));
});
origin: apache/eagle

Assert.assertEquals(0, topologyUsage.getAlertBoltUsage(slot.getBoltId()).getReferQueues().size());
origin: apache/eagle

  group1Slots.add(slot.getBoltId());
});
Assert.assertEquals(2, getMonitorStream(usage.getMonitoredStream()).get(group2).getQueues().get(0).getWorkingSlots().size());
getMonitorStream(usage.getMonitoredStream()).get(group2).getQueues().get(0).getWorkingSlots().forEach(slot -> {
  Assert.assertTrue(!group1Slots.contains(slot.getBoltId()));
});
origin: apache/eagle

for (WorkSlot slot : queues.get(0).getWorkers()) {
  Assert.assertEquals(topo1, slot.getTopologyName());
  LOG.info(slot.getBoltId());
origin: apache/eagle

for (WorkSlot slot : queues.get(0).getWorkers()) {
  Assert.assertEquals(topo1, slot.getTopologyName());
  LOG.info(slot.getBoltId());
origin: apache/eagle

bolt1 = queue.getWorkingSlots().get(0).getBoltId();
Assert.assertEquals(1, context.getTopologies().size());
Assert.assertEquals(1, context.getTopologyUsages().size());
String bolt2 = queue.getWorkingSlots().get(0).getBoltId();
for (WorkSlot ws : queue.getWorkingSlots()) {
  Assert.assertEquals(topo2, ws.getTopologyName());
origin: apache/eagle

  @Test
  public void testWorkSlot() {
    WorkSlot workSlot = new WorkSlot();
    Assert.assertEquals("(null:null)", workSlot.toString());
    Assert.assertEquals(null, workSlot.getBoltId());
    Assert.assertEquals(null, workSlot.getTopologyName());
    workSlot.setBoltId("setBoltId");
    workSlot.setTopologyName("setTopologyName");
    Assert.assertEquals("(setTopologyName:setBoltId)", workSlot.toString());
    Assert.assertEquals("setBoltId", workSlot.getBoltId());
    Assert.assertEquals("setTopologyName", workSlot.getTopologyName());

    WorkSlot workSlot1 = new WorkSlot("setTopologyName", "setBoltId");
    Assert.assertEquals("(setTopologyName:setBoltId)", workSlot1.toString());
    Assert.assertEquals("setBoltId", workSlot1.getBoltId());
    Assert.assertEquals("setTopologyName", workSlot1.getTopologyName());
    Assert.assertTrue(workSlot1.equals(workSlot));
    Assert.assertTrue(workSlot1.hashCode() == workSlot.hashCode());
  }
}
org.apache.eagle.alert.coordination.modelWorkSlotgetBoltId

Popular methods of WorkSlot

  • <init>
  • getTopologyName
  • equals
  • hashCode
  • setBoltId
  • setTopologyName
  • toString

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • requestLocationUpdates (LocationManager)
  • onCreateOptionsMenu (Activity)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
  • From CI to AI: The AI layer in your organization
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