This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
USER_ARGS="-Dsomething=$1" | |
COMPILATION_CLASSPATH=`find -L ./target -maxdepth 1 -name "*.jar" -type f -exec printf :{} ';'` | |
JAVA_OPTS="-server -XX:+UseThreadPriorities -XX:ThreadPriorityPolicy=42 -Xms512M -Xmx2048M -XX:+HeapDumpOnOutOfMemoryError -XX:+AggressiveOpts -XX:+OptimizeStringConcat -XX:+UseFastAccessorMethods -XX:+UseParNewGC -XX:+UseConcMarkSweepGC -XX:+CMSParallelRemarkEnabled -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv6Addresses=false ${JAVA_OPTS}" | |
java $JAVA_OPTS $USER_ARGS -cp $COMPILATION_CLASSPATH io.gatling.app.Gatling -s your.simulation.FullClassName |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xml.etree.ElementTree as ET | |
def main(): | |
configs = {'in-memory-format': 'BINARY', | |
'backup-count': '1', | |
'eviction-policy': 'LRU', | |
'eviction-percentage': '25', | |
'min-eviction-check-millis': '100', | |
'merge-policy': 'com.hazelcast.map.merge.PutIfAbsentMapMergePolicy'} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import hazelcast, logging, sys | |
import signal | |
def log_cache_info(cache, client): | |
cache = client.get_map(cache).blocking() | |
logging.info( | |
"CacheName: " + cache.name + " CacheSize: " + str(cache.size()) + " KlusterSize: " + str(client.cluster.size()) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.jamasoftware.search.util.analyzer; | |
/** | |
* Licensed to the Apache Software Foundation (ASF) under one or more | |
* contributor license agreements. See the NOTICE file distributed with | |
* this work for additional information regarding copyright ownership. | |
* The ASF licenses this file to You under the Apache License, Version 2.0 | |
* (the "License"); you may not use this file except in compliance with | |
* the License. You may obtain a copy of the License at | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jamasearch.enabled=true | |
jamasearch.url=http://localhost:7500 | |
envers.enabled=true | |
jamasearch.multithreadindex.chunksize=2000 | |
jamasearch.multithreadindex.enabled=true | |
jamasearch.multithreadindex.poolsize=10 | |
jamasearch.indexRefactorEnabled=true | |
jamasearch.indexRefactorCompareEnabled=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void compareDocs(Map<String, Object> responseMap, List<IndexField> listOfIndexFields, VerificationResponse verificationFailureResponse) { | |
for (int i = 0; i < listOfIndexFields.size(); ++i) { | |
@SuppressWarnings("unchecked") //Indexed are always object lists | |
ArrayList<Object> value = (ArrayList<Object>) responseMap.get(listOfIndexFields.get(i).getFieldName()); | |
if (!listOfIndexFields.get(i).getFieldValues()[0].equals(value.get(0))) { | |
MisMatchFields misMatchFields = new MisMatchFields(value.get(i).toString(), listOfIndexFields.get(i).getFieldValues()[0]); | |
misMatchFields.setField(listOfIndexFields.get(i).getFieldName()); | |
verificationFailureResponse.addToListOfMisMatchedFields(misMatchFields); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void indexItemsForOpenTenants() { | |
Integer numberOfTries = 0; | |
List<String> itemsToIndex = TenantManager.getTenants().stream().filter(isOpenTenant).collect(Collectors.toList()); | |
try { | |
while (!itemsToIndex.isEmpty()) { | |
if (abort.get() || numberOfTries >= counterThreshold) { // break if abort is true or counter is more than 10 hours | |
logger.warn(String.format("Aborting indexAllTenants: abort: %s, counter: %s", abort.get(), numberOfTries)); | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.concretepage.util.concurrent; | |
import java.util.Arrays; | |
import java.util.List; | |
import java.util.concurrent.CompletableFuture; | |
public class CompletableFutureOneExample { | |
public static void main(String[] args) throws InterruptedException { | |
List<Integer> list = Arrays.asList(10,20,30,40); | |
list.stream().map(data->CompletableFuture.supplyAsync(()->getNumber(data))). | |
map(compFuture->compFuture.thenApply(n->n*n)).map(t->t.join()) | |
.forEach(s->System.out.println(s)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DocumentServiceImpl.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DocumentServiceImpl.java |