stromId: MobileUV_7-212-1409657868
@param stormId
345529
public void restartTopology(String stormId){
        String currentTopology = StringUtils.substringBefore(stormId, "-");
        String topologyPrefix = StringUtils.substringBefore(currentTopology, "_");
        String topologyIndex =  StringUtils.substringAfter(currentTopology, "_");
        int newIndex = Integer.parseInt(topologyIndex) + 1;
        String newTopologyName = topologyPrefix + "_" + newIndex;
        LOGGER.info("new topology name = " + newTopologyName);
        execStartCommand(newTopologyName);
        LOGGER.info("execStartCommand finish ..");
        execShutdownCommand(currentTopology);
        LOGGER.info("execShutdownCommand finish ..");
    }
1260410
public Contact updateContact(final String id, ContactRequest contactRequest) throws UnauthorizedException, GeneralException {
        if (id == null) {
            throw new IllegalArgumentException("Contact ID must be specified.");
        }
        String request = CONTACTPATH + "/" + id;
        return messageBirdService.sendPayLoad("PATCH", request, contactRequest, Contact.class);
    }
703014
public static void validate_basic(StormTopology topology, Map<Object, Object> totalStormConf,
                                      String topologyId) throws InvalidTopologyException {
        validate_ids(topology, topologyId);

        for (StormTopology._Fields field : Thrift.SPOUT_FIELDS) {
            Object value = topology.getFieldValue(field);
            if (value != null) {
                Map<String, Object> obj_map = (Map<String, Object>) value;
                for (Object obj : obj_map.values()) {
                    validate_component_inputs(obj);
                }
            }
        }

        Integer workerNum = JStormUtils.parseInt(totalStormConf.get(Config.TOPOLOGY_WORKERS));
        if (workerNum == null || workerNum <= 0) {
            String errMsg = "There is no Config.TOPOLOGY_WORKERS in configuration of " + topologyId;
            throw new InvalidParameterException(errMsg);
        }

        Integer ackerNum = JStormUtils.parseInt(totalStormConf.get(Config.TOPOLOGY_ACKER_EXECUTORS));
        if (ackerNum != null && ackerNum < 0) {
            String errMsg = "Invalid Config.TOPOLOGY_ACKERS in configuration of " + topologyId;
            throw new InvalidParameterException(errMsg);
        }

    }
937570
private Integer mapTaskID(Integer id)
   {
      Integer mappedID = m_clashMap.get(id);
      if (mappedID == null)
      {
         mappedID = id;
      }
      return (mappedID);
   }
455214
public JsonResponse updateBlast(Integer blastId) throws IOException {
        Blast blast = new Blast();
        blast.setBlastId(blastId);
        return apiPost(blast);
    }
816936
@SuppressWarnings("unchecked")
    public static void validate_ids(StormTopology topology, String topologyId) throws InvalidTopologyException {
        String topologyName = topologyIdToName(topologyId);
        if (!charValidate(topologyName)) {
            throw new InvalidTopologyException(topologyName + " is not a valid topology name. " + nameErrorInfo);
        }

        List<String> list = new ArrayList<>();
        for (StormTopology._Fields field : Thrift.STORM_TOPOLOGY_FIELDS) {
            Object value = topology.getFieldValue(field);
            if (value != null) {
                Map<String, Object> obj_map = (Map<String, Object>) value;
                Set<String> commids = obj_map.keySet();

                for (String id : commids) {
                    if (system_id(id) || !charComponentValidate(id)) {
                        throw new InvalidTopologyException(id + " is not a valid component id. " + compErrorInfo);
                    }
                }

                for (Object obj : obj_map.values()) {
                    validate_component(obj);
                }

                list.addAll(commids);
            }
        }

        List<String> offending = JStormUtils.getRepeat(list);
        if (!offending.isEmpty()) {
            throw new InvalidTopologyException("Duplicate component ids: " + offending);
        }
    }
1030860
@Override
    public StormTopology getTopology(String id) throws TException {
        StormTopology topology;
        try {
            StormTopology stormtopology = StormConfig.read_nimbus_topology_code(id, data.getBlobStore());
            if (stormtopology == null) {
                throw new NotAliveException("No topology of " + id);
            }

            Map<Object, Object> topologyConf = (Map<Object, Object>) StormConfig.read_nimbus_topology_conf(id, data.getBlobStore());
            topology = Common.system_topology(topologyConf, stormtopology);
        } catch (Exception e) {
            LOG.error("Failed to get topology " + id + ",", e);
            throw new TException("Failed to get system_topology");
        }
        return topology;
    }
498310
public void setDeviceId(byte[] deviceId) {
    if (deviceId == null) {
      throw new RuntimeException("Device ID cannot be null.");
    }
    if (deviceId.length != DEVICE_ID_SIZE) {
      throw new RuntimeException(String.format(
          "Device ID must be %d bytes long.", Integer.valueOf(DEVICE_ID_SIZE)));
    }
    this.deviceId = deviceId;
  }
652088
def rgfromid(idstr):
    ''''''
    rgidx = idstr.find('resourceGroups/')
    providx = idstr.find('/providers/')
    return idstr[rgidx + 15:providx]
428390
def get_straat_by_id(self, id):
        '''
        
        '''
        def creator():
            res = crab_gateway_request(
                self.client, 'GetStraatnaamWithStatusByStraatnaamId', id
            )
            if res == None:
                 raise GatewayResourceNotFoundException()
            return Straat(
                res.StraatnaamId,
                res.StraatnaamLabel,
                res.GemeenteId,
                res.StatusStraatnaam,
                res.Straatnaam,
                res.TaalCode,
                res.StraatnaamTweedeTaal,
                res.TaalCodeTweedeTaal,
                Metadata(
                    res.BeginDatum,
                    res.BeginTijd,
                    self.get_bewerking(res.BeginBewerking),
                    self.get_organisatie(res.BeginOrganisatie)
                )
            )

        if self.caches['long'].is_configured:
            key = 'GetStraatnaamWithStatusByStraatnaamId#%s' % (id)
            straat = self.caches['long'].get_or_create(key, creator)
        else:
            straat = creator()
        straat.set_gateway(self)
        return straat
601397
public Integer delete(String spaceId) {
    assertNotNull(spaceId, "spaceId");
    return service.delete(spaceId).blockingFirst().code();
  }
852540
def _logStormQuery(self, text, user):
        '''
        
        '''
        if self.conf.get('storm:log'):
            lvl = self.conf.get('storm:log:level')
            logger.log(lvl, 'Executing storm query {%s} as [%s]', text, user.name)
1001187
public SIMPRemoteQueuePointControllable getRemoteQueuePointControlByMEUuid(String id) throws SIMPInvalidRuntimeIDException, SIMPControllableNotFoundException, SIMPException
  {
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(
        tc,
        "getRemoteQueuePointControlByMEUuid",
        new Object[] { id });
    
    assertMessageHandlerNotCorrupt();
    
//  ids are assumed to be SIBUuid8 format
    SIBUuid8 uuid = null;
    try
    {
      uuid = new SIBUuid8(id);
    }
    catch(NumberFormatException e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.impl.Queue.getRemoteQueuePointControlByMEUuid",
        "1:172:1.30",
        this);
    
      SIMPInvalidRuntimeIDException finalE =
        new SIMPInvalidRuntimeIDException(
          nls.getFormattedMessage(
            "INTERNAL_MESSAGING_ERROR_CWSIP0003",
            new Object[] {"Queue.getRemoteQueuePointControlByMEUuid",
                "1:180:1.30",
                          e,
                          id},
            null), e);

      SibTr.exception(tc, finalE);
      SibTr.error(tc,"INTERNAL_MESSAGING_ERROR_CWSIP0003",
      new Object[] {"Queue.getRemoteQueuePointControlByMEUuid",
          "1:188:1.30",
                    e,
                    id}); 
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getRemoteQueuePointControlByMEUuid", finalE);
      throw finalE;            
    }
    
    // TODO : shouldnt provide null here... should provide the consumerSetId
    SIMPRemoteQueuePointControllable remote = baseDest.getRemoteQueuePointControl(uuid, false);
    if(remote == null)
    {
      SIMPControllableNotFoundException finalE =
        new SIMPControllableNotFoundException(
          nls.getFormattedMessage(
            "INTERNAL_MESSAGING_ERROR_CWSIP0003",
            new Object[] {"Queue.getRemoteQueuePointControlByMEUuid",
                          "1:204:1.30",
                          id},
            null));     

      SibTr.exception(tc, finalE);
      SibTr.error(tc, "INTERNAL_MESSAGING_ERROR_CWSIP0003",
      new Object[] {"Queue.getRemoteQueuePointControlByMEUuid",
                    "1:211:1.30",
                    id});
      if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "getRemoteQueuePointControlByMEUuid", finalE);
      throw finalE; 
    }
    
    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "getRemoteQueuePointControlByMEUuid", remote);
    
    return remote;
  }
1247259
public final void setGuaranteedTargetMessagingEngineUUID(SIBUuid8 value) {
    if (value != null)
      jmo.setField(ControlAccess.TARGETMEUUID, value.toByteArray());
    else
      jmo.setField(ControlAccess.TARGETMEUUID, null);
  }
91304
private synchronized int getStartingMessageId(final Follower follower) {
        if (this.isFollowerActive(follower)) {
            return this.runningFollowerStartMarks.getInt(follower);
        } else if (this.isFollowerTerminated(follower)) {
            return this.terminatedFollowerRanges.get(follower)[0];
        } else {
            throw new IllegalStateException("Follower never before seen.");
        }
    }
1208979
protected String expandSystemId(String baseId, String systemId) {
        return getRequest().expandSystemId(baseId, systemId);
    }
377822
public static void main(String[] args) {

		 List<String> tmpArgs = new ArrayList<String>(Arrays.asList(args));
		
		boolean isLocal = isLocal(tmpArgs);
		int numWorker = StormSamoaUtils.numWorkers(tmpArgs);
		
		args = tmpArgs.toArray(new String[0]);
		
		//convert the arguments into Storm topology
		StormTopology stormTopo = StormSamoaUtils.argsToTopology(args);
		String topologyName = stormTopo.getTopologyName();
		
    	Config conf = new Config();
    	conf.putAll(Utils.readStormConfig());
    	conf.setDebug(false);
    			
    	
		if(isLocal){
			//local mode
			conf.setMaxTaskParallelism(numWorker);
			
			backtype.storm.LocalCluster cluster = new backtype.storm.LocalCluster();
			cluster.submitTopology(topologyName , conf, stormTopo.getStormBuilder().createTopology());
			
			backtype.storm.utils.Utils.sleep(600*1000);
			
			cluster.killTopology(topologyName);
			cluster.shutdown();
			
		}else{
			//cluster mode
			conf.setNumWorkers(numWorker);
			try {
				backtype.storm.StormSubmitter.submitTopology(topologyName, conf,
						stormTopo.getStormBuilder().createTopology());
			} catch (backtype.storm.generated.AlreadyAliveException ale) {
				ale.printStackTrace();
			} catch (backtype.storm.generated.InvalidTopologyException ite) {
				ite.printStackTrace();
			}
		}
	}