org.eclipse.jetty.util.ConcurrentHashSet Java Examples

The following examples show how to use org.eclipse.jetty.util.ConcurrentHashSet. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GoQueueTest.java    From gocd with Apache License 2.0 6 votes vote down vote up
@Test
public void shouldNotifyOneListenerForEachMessage() throws InterruptedException {
    GoMessageQueue<GoMessage> queue = new GoMessageQueue<>(messageService, "TestQueue");

    int numberOfListeners = 2;
    int numberOfMessages = numberOfListeners + 2;

    for (int i = 0; i < numberOfListeners; i++) {
        queue.addListener(new StubGoMessageListener(i));
    }

    Set<String> expectMessages = new ConcurrentHashSet<>();
    for (int i = 0; i < numberOfMessages; i++) {
        String text = "Message-" + i;
        queue.post(new GoTextMessage(text));
        expectMessages.add(text);
    }

    assertWillHappen(receivedMessage, is(expectMessages), Timeout.FIVE_SECONDS);
}
 
Example #2
Source File: SubPipelineExecutor.java    From hop with Apache License 2.0 5 votes vote down vote up
public SubPipelineExecutor( String subPipelineName, IPipelineEngine<PipelineMeta> parentPipeline, PipelineMeta subPipelineMeta, boolean shareVariables,
                            PipelineExecutorParameters parameters, String subTransform, PipelineRunConfiguration runConfiguration ) {
  this.subPipelineName = subPipelineName;
  this.parentPipeline = parentPipeline;
  this.subPipelineMeta = subPipelineMeta;
  this.shareVariables = shareVariables;
  this.parameters = parameters;
  this.subTransform = subTransform;
  this.statuses = new LinkedHashMap<>();
  this.running = new ConcurrentHashSet<>();
  this.runConfiguration = runConfiguration;
}
 
Example #3
Source File: NINO.java    From FlareBot with MIT License 5 votes vote down vote up
public NINO() {
    this.whitelistedUrls = new ConcurrentHashSet<>();
    this.whitelistedChannels = new ConcurrentHashSet<>();
    this.whitelistedUrls.add("discord.gg/discord-developers");
    this.whitelistedUrls.add("discord.gg/TTAUGvZ");
    this.removeMessages.add("No no no, you post not an invite here!\nYes, hmmm.");
}
 
Example #4
Source File: ConfirmUtil.java    From FlareBot with MIT License 5 votes vote down vote up
public static void pushAction(String userID, RunnableWrapper action) {
    Set<RunnableWrapper> actions = confirmCache.getIfPresent(userID);
    if (actions != null) {
        if (actions.stream().noneMatch(wrapper -> wrapper.getOrigin().equals(action.getOrigin()))) {
            actions.add(action);
        }
    } else {
        Set<RunnableWrapper> newActions = new ConcurrentHashSet<>();
        newActions.add(action);
        confirmCache.put(userID, newActions);
    }
}
 
Example #5
Source File: FileEventManager.java    From PeerWasp with MIT License 5 votes vote down vote up
/**
 *
 * @param fileTree The file tree representation of PeerWasp
 * @param messageBus To publish events system-wide
 */
   @Inject
public FileEventManager(final FileTree fileTree, MessageBus messageBus) {
   	this.fileComponentQueue = new FileComponentQueue();
	this.fileTree = fileTree;
	this.messageBus = messageBus;
	this.failedOperations = new ConcurrentHashSet<Path>();
}
 
Example #6
Source File: SubtransExecutor.java    From pentaho-kettle with Apache License 2.0 5 votes vote down vote up
public SubtransExecutor( String subTransName, Trans parentTrans, TransMeta subtransMeta, boolean shareVariables,
                         TransExecutorParameters parameters, String subStep, int prefetchCount ) {
  this.subTransName = subTransName;
  this.parentTrans = parentTrans;
  this.subtransMeta = subtransMeta;
  this.shareVariables = shareVariables;
  this.parameters = parameters;
  this.subStep = subStep;
  this.statuses = new LinkedHashMap<>();
  this.running = new ConcurrentHashSet<>();
  this.prefetchCount = prefetchCount;
  this.semaphore = new Semaphore( prefetchCount );
}
 
Example #7
Source File: JobThread.java    From open-capacity-platform with Apache License 2.0 4 votes vote down vote up
public JobThread(int jobId, IJobHandler handler) {
	this.jobId = jobId;
	this.handler = handler;
	this.triggerQueue = new LinkedBlockingQueue<TriggerParam>();
	this.triggerLogIdSet = new ConcurrentHashSet<Integer>();
}
 
Example #8
Source File: JsonGraph.java    From hugegraph-tools with Apache License 2.0 4 votes vote down vote up
public JsonVertex() {
    this.edges = new ConcurrentHashSet<>();
}
 
Example #9
Source File: Group.java    From FlareBot with MIT License 4 votes vote down vote up
public ConcurrentHashSet<String> getPermissions() {
    return permissions;
}
 
Example #10
Source File: GuildSettings.java    From FlareBot with MIT License 4 votes vote down vote up
public GuildSettings() {
    this.deleteCommands = true;
    this.channelBlacklist = new ConcurrentHashSet<>();
    this.userBlacklist = new ConcurrentHashSet<>();
}
 
Example #11
Source File: StressTestUnisolatedReadWriteIndex.java    From database with GNU General Public License v2.0 4 votes vote down vote up
public WriteTask(final Journal journal,
        final String[] resource, final int trial, final int keyLen,
        final int nops, final double failureRate, final double commitRate,
        final ConcurrentHashSet<Thread> threads) {

    this.journal = journal;
    
    this.resource = resource;

    this.trial = trial;
    
    this.keyLen = keyLen;
    
    this.nops = nops;
    
    this.failureRate = failureRate;
    
    this.commitRate = commitRate;
    
    this.threads = threads;
    
}
 
Example #12
Source File: FileTree.java    From PeerWasp with MIT License 4 votes vote down vote up
@Override
public Set<Path> getSynchronizedPathsAsSet() {
	Set<Path> synchronizedFiles = new ConcurrentHashSet<Path>();
	rootOfFileTree.getSynchronizedChildrenPaths(synchronizedFiles);
	return synchronizedFiles;
}