repo_name stringlengths 7 104 | file_path stringlengths 13 198 | context stringlengths 67 7.15k | import_statement stringlengths 16 4.43k | code stringlengths 40 6.98k | prompt stringlengths 227 8.27k | next_line stringlengths 8 795 |
|---|---|---|---|---|---|---|
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/HyperLogLogReplicationOperation.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogService.java
// public class HyperLogLogService implements ManagedService, RemoteService, MigrationAwareService {
//
// public static final String SERVICE_NAME = "rakam:hyperLogLogService";
//
// private NodeEngine nodeEngine;
// priv... | import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
import com.hazelcast.spi.AbstractOperation;
import org.rakam.cache.hazelcast.hyperloglog.HyperLogLogService;
import org.rakam.util.HLLWrapper;
import java.io.IOExceptio... | /**
* Created by buremba on 10/07/14.
*/
package org.rakam.cache.hazelcast.hyperloglog.operations;
public class HyperLogLogReplicationOperation extends AbstractOperation implements IdentifiedDataSerializable {
private Map<String, byte[]> migrationData;
public HyperLogLogReplicationOperation() {
}
... | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogService.java
// public class HyperLogLogService implements ManagedService, RemoteService, MigrationAwareService {
//
// public static final String SERVICE_NAME = "rakam:hyperLogLogService";
//
// private NodeEngine nodeEngine;
// priv... | HyperLogLogService service = getService(); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/HyperLogLogReplicationOperation.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogService.java
// public class HyperLogLogService implements ManagedService, RemoteService, MigrationAwareService {
//
// public static final String SERVICE_NAME = "rakam:hyperLogLogService";
//
// private NodeEngine nodeEngine;
// priv... | import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
import com.hazelcast.spi.AbstractOperation;
import org.rakam.cache.hazelcast.hyperloglog.HyperLogLogService;
import org.rakam.util.HLLWrapper;
import java.io.IOExceptio... | /**
* Created by buremba on 10/07/14.
*/
package org.rakam.cache.hazelcast.hyperloglog.operations;
public class HyperLogLogReplicationOperation extends AbstractOperation implements IdentifiedDataSerializable {
private Map<String, byte[]> migrationData;
public HyperLogLogReplicationOperation() {
}
... | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogService.java
// public class HyperLogLogService implements ManagedService, RemoteService, MigrationAwareService {
//
// public static final String SERVICE_NAME = "rakam:hyperLogLogService";
//
// private NodeEngine nodeEngine;
// priv... | HLLWrapper number = service.getHLL(name); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLog.java | // Path: src/main/java/org/rakam/util/HLLWrapper.java
// public class HLLWrapper {
// final private static int SEED = 123456;
// private HLL hll;
//
// public HLLWrapper() {
// hll = new HLL(13/*log2m*/, 5/*registerWidth*/);
// }
//
// public HLLWrapper(byte[] bytes) {
// hll = HLL... | import java.util.Collection;
import com.hazelcast.core.DistributedObject;
import org.rakam.util.HLLWrapper; | /**
* Created by buremba <Burak Emre Kabakcı> on 10/07/14.
*/
package org.rakam.cache.hazelcast.hyperloglog;
public interface HyperLogLog extends DistributedObject {
/**
* Returns the name of this HyperLogLog instance.
*
* @return name of this instance
*/
String getName();
/**
... | // Path: src/main/java/org/rakam/util/HLLWrapper.java
// public class HLLWrapper {
// final private static int SEED = 123456;
// private HLL hll;
//
// public HLLWrapper() {
// hll = new HLL(13/*log2m*/, 5/*registerWidth*/);
// }
//
// public HLLWrapper(byte[] bytes) {
// hll = HLL... | public void union(HLLWrapper hll); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/treemap/client/GetRequest.java | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/operations/GetOperation.java
// public class GetOperation extends TreeMapBaseOperation {
// private Integer numberOfElements = null;
// private Map<String, Long> returnValue;
//
// public GetOperation(String name) {
// super(name);
// }
/... | import com.hazelcast.nio.serialization.PortableReader;
import com.hazelcast.nio.serialization.PortableWriter;
import com.hazelcast.spi.Operation;
import org.rakam.cache.hazelcast.treemap.operations.GetOperation;
import java.io.IOException; | package org.rakam.cache.hazelcast.treemap.client;
/**
* Created by buremba <Burak Emre Kabakcı> on 19/07/14 20:24.
*/
public class GetRequest extends ReadRequest {
private Integer limit;
public GetRequest(String name, Integer limit) {
super(name);
this.limit = limit==null ? -1 : limit;
... | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/operations/GetOperation.java
// public class GetOperation extends TreeMapBaseOperation {
// private Integer numberOfElements = null;
// private Map<String, Long> returnValue;
//
// public GetOperation(String name) {
// super(name);
// }
/... | return new GetOperation(name, limit==-1 ? null : limit); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/client/ReadRequest.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogService.java
// public class HyperLogLogService implements ManagedService, RemoteService, MigrationAwareService {
//
// public static final String SERVICE_NAME = "rakam:hyperLogLogService";
//
// private NodeEngine nodeEngine;
// priv... | import com.hazelcast.client.ClientEngine;
import com.hazelcast.client.PartitionClientRequest;
import com.hazelcast.client.SecureRequest;
import com.hazelcast.nio.serialization.Data;
import com.hazelcast.nio.serialization.Portable;
import com.hazelcast.nio.serialization.PortableReader;
import com.hazelcast.nio.serializa... | /**
* Created by buremba <Burak Emre Kabakcı> on 10/07/14.
*/
package org.rakam.cache.hazelcast.hyperloglog.client;
public abstract class ReadRequest extends PartitionClientRequest implements Portable, SecureRequest {
protected String name;
public ReadRequest() {
}
public ReadRequest(String nam... | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogService.java
// public class HyperLogLogService implements ManagedService, RemoteService, MigrationAwareService {
//
// public static final String SERVICE_NAME = "rakam:hyperLogLogService";
//
// private NodeEngine nodeEngine;
// priv... | return HyperLogLogService.SERVICE_NAME; |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/customMap/operations/IncrementByOperation.java | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/operations/IncrementByBackupOperation.java
// public class IncrementByBackupOperation extends TreeMapBaseOperation implements BackupOperation {
// private long by;
//
// public IncrementByBackupOperation(String name, long by) {
// super(name);
//... | import com.hazelcast.map.operation.KeyBasedMapOperation;
import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.Data;
import com.hazelcast.spi.BackupAwareOperation;
import com.hazelcast.spi.Operation;
import org.rakam.cache.hazelcast.treemap.operation... | @Override
public void run() throws Exception {
getService();
}
@Override
public Object getResponse() {
return null;
}
@Override
public boolean shouldBackup() {
return true;
}
@Override
public int getSyncBackupCount() {
return 0;
}
... | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/operations/IncrementByBackupOperation.java
// public class IncrementByBackupOperation extends TreeMapBaseOperation implements BackupOperation {
// private long by;
//
// public IncrementByBackupOperation(String name, long by) {
// super(name);
//... | return new IncrementByBackupOperation(); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/client/ResetRequest.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/ResetOperation.java
// public class ResetOperation extends HyperLogLogBackupAwareOperation {
//
//
// public ResetOperation() {
// }
//
// public ResetOperation(String name) {
// super(name);
// }
//
// @Override
// ... | import com.hazelcast.spi.Operation;
import org.rakam.cache.hazelcast.hyperloglog.operations.ResetOperation; | package org.rakam.cache.hazelcast.hyperloglog.client;
/**
* Created by buremba <Burak Emre Kabakcı> on 11/07/14 16:18.
*/
public class ResetRequest extends WriteRequest {
public ResetRequest(String name) {
super(name);
}
public ResetRequest() {
}
@Override
protected Operation pre... | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/ResetOperation.java
// public class ResetOperation extends HyperLogLogBackupAwareOperation {
//
//
// public ResetOperation() {
// }
//
// public ResetOperation(String name) {
// super(name);
// }
//
// @Override
// ... | return new ResetOperation(name); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/treemap/operations/GetOperation.java | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/TreeMapService.java
// public class TreeMapService implements ManagedService, RemoteService, MigrationAwareService {
//
// public static final String SERVICE_NAME = "rakam:treeMapService";
//
// private NodeEngine nodeEngine;
// private final Concur... | import org.rakam.cache.hazelcast.treemap.TreeMapService;
import java.util.Map; | package org.rakam.cache.hazelcast.treemap.operations;
/**
* Created by buremba <Burak Emre Kabakcı> on 15/07/14 02:34.
*/
public class GetOperation extends TreeMapBaseOperation {
private Integer numberOfElements = null;
private Map<String, Long> returnValue;
public GetOperation(String name) {
... | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/TreeMapService.java
// public class TreeMapService implements ManagedService, RemoteService, MigrationAwareService {
//
// public static final String SERVICE_NAME = "rakam:treeMapService";
//
// private NodeEngine nodeEngine;
// private final Concur... | TreeMapService service = getService(); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/treemap/TreeMapService.java | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/operations/TreeMapReplicationOperation.java
// public class TreeMapReplicationOperation extends AbstractOperation implements IdentifiedDataSerializable {
//
// private Map<String, OrderedCounterMap> migrationData;
//
// public TreeMapReplicationOperatio... | import com.hazelcast.partition.InternalPartitionService;
import com.hazelcast.partition.MigrationEndpoint;
import com.hazelcast.spi.*;
import com.hazelcast.util.ConstructorFunction;
import org.rakam.cache.hazelcast.treemap.operations.TreeMapReplicationOperation;
import java.util.HashMap;
import java.util.Iterator;
impo... |
@Override
public void shutdown(boolean terminate) {
reset();
}
@Override
public TreeMapProxy createDistributedObject(String name) {
return new TreeMapProxy(name, nodeEngine, this);
}
@Override
public void destroyDistributedObject(String name) {
containers.remov... | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/operations/TreeMapReplicationOperation.java
// public class TreeMapReplicationOperation extends AbstractOperation implements IdentifiedDataSerializable {
//
// private Map<String, OrderedCounterMap> migrationData;
//
// public TreeMapReplicationOperatio... | return data.isEmpty() ? null : new TreeMapReplicationOperation(data); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/client/AddAllRequest.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/AddAllOperation.java
// public class AddAllOperation extends HyperLogLogBackupAwareOperation {
//
// private Collection<String> items;
//
// public AddAllOperation() {
// }
//
// public AddAllOperation(String name, Collection<Str... | import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.PortableReader;
import com.hazelcast.nio.serialization.PortableWriter;
import com.hazelcast.spi.Operation;
import org.rakam.cache.hazelcast.hyperloglog.operations.AddAllOperation;
import java.io.I... | /**
* Created by buremba <Burak Emre Kabakcı> on 10/07/14.
*/
package org.rakam.cache.hazelcast.hyperloglog.client;
public class AddAllRequest extends WriteRequest {
private Collection<String> items;
public AddAllRequest() {
}
protected AddAllRequest(String name, Collection<String> items) {
... | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/AddAllOperation.java
// public class AddAllOperation extends HyperLogLogBackupAwareOperation {
//
// private Collection<String> items;
//
// public AddAllOperation() {
// }
//
// public AddAllOperation(String name, Collection<Str... | return new AddAllOperation(name, items); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogService.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/HyperLogLogReplicationOperation.java
// public class HyperLogLogReplicationOperation extends AbstractOperation implements IdentifiedDataSerializable {
//
// private Map<String, byte[]> migrationData;
//
// public HyperLogLogReplicationOpe... | import com.hazelcast.partition.InternalPartitionService;
import com.hazelcast.partition.MigrationEndpoint;
import com.hazelcast.spi.*;
import com.hazelcast.util.ConstructorFunction;
import org.rakam.cache.hazelcast.hyperloglog.operations.HyperLogLogReplicationOperation;
import org.rakam.util.HLLWrapper;
import java.uti... | /**
* Created by buremba <Burak Emre Kabakcı> on 10/07/14.
*/
package org.rakam.cache.hazelcast.hyperloglog;
public class HyperLogLogService implements ManagedService, RemoteService, MigrationAwareService {
public static final String SERVICE_NAME = "rakam:hyperLogLogService";
private NodeEngine nodeEng... | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/HyperLogLogReplicationOperation.java
// public class HyperLogLogReplicationOperation extends AbstractOperation implements IdentifiedDataSerializable {
//
// private Map<String, byte[]> migrationData;
//
// public HyperLogLogReplicationOpe... | private final ConcurrentMap<String, HLLWrapper> containers = new ConcurrentHashMap<String, HLLWrapper>(); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogService.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/HyperLogLogReplicationOperation.java
// public class HyperLogLogReplicationOperation extends AbstractOperation implements IdentifiedDataSerializable {
//
// private Map<String, byte[]> migrationData;
//
// public HyperLogLogReplicationOpe... | import com.hazelcast.partition.InternalPartitionService;
import com.hazelcast.partition.MigrationEndpoint;
import com.hazelcast.spi.*;
import com.hazelcast.util.ConstructorFunction;
import org.rakam.cache.hazelcast.hyperloglog.operations.HyperLogLogReplicationOperation;
import org.rakam.util.HLLWrapper;
import java.uti... | @Override
public void shutdown(boolean terminate) {
reset();
}
@Override
public HyperLogLogProxy createDistributedObject(String name) {
return new HyperLogLogProxy(name, nodeEngine, this);
}
@Override
public void destroyDistributedObject(String name) {
container... | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/HyperLogLogReplicationOperation.java
// public class HyperLogLogReplicationOperation extends AbstractOperation implements IdentifiedDataSerializable {
//
// private Map<String, byte[]> migrationData;
//
// public HyperLogLogReplicationOpe... | return data.isEmpty() ? null : new HyperLogLogReplicationOperation(data); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/treemap/client/ReadRequest.java | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/TreeMapService.java
// public class TreeMapService implements ManagedService, RemoteService, MigrationAwareService {
//
// public static final String SERVICE_NAME = "rakam:treeMapService";
//
// private NodeEngine nodeEngine;
// private final Concur... | import com.hazelcast.client.ClientEngine;
import com.hazelcast.client.PartitionClientRequest;
import com.hazelcast.client.SecureRequest;
import com.hazelcast.nio.serialization.Data;
import com.hazelcast.nio.serialization.Portable;
import com.hazelcast.nio.serialization.PortableReader;
import com.hazelcast.nio.serializa... | /**
* Created by buremba <Burak Emre Kabakcı> on 10/07/14.
*/
package org.rakam.cache.hazelcast.treemap.client;
public abstract class ReadRequest extends PartitionClientRequest implements Portable, SecureRequest {
protected String name;
public ReadRequest() {
}
public ReadRequest(String name) {... | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/TreeMapService.java
// public class TreeMapService implements ManagedService, RemoteService, MigrationAwareService {
//
// public static final String SERVICE_NAME = "rakam:treeMapService";
//
// private NodeEngine nodeEngine;
// private final Concur... | return TreeMapService.SERVICE_NAME; |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/client/ClientHyperLogLogProxyFactory.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogService.java
// public class HyperLogLogService implements ManagedService, RemoteService, MigrationAwareService {
//
// public static final String SERVICE_NAME = "rakam:hyperLogLogService";
//
// private NodeEngine nodeEngine;
// priv... | import com.hazelcast.client.spi.ClientProxyFactory;
import org.rakam.cache.hazelcast.hyperloglog.HyperLogLogService;
import com.hazelcast.client.spi.ClientProxy; | /**
* Created by buremba <Burak Emre Kabakcı> on 10/07/14.
*/
package org.rakam.cache.hazelcast.hyperloglog.client;
public class ClientHyperLogLogProxyFactory implements ClientProxyFactory {
@Override
public ClientProxy create(String s) { | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogService.java
// public class HyperLogLogService implements ManagedService, RemoteService, MigrationAwareService {
//
// public static final String SERVICE_NAME = "rakam:hyperLogLogService";
//
// private NodeEngine nodeEngine;
// priv... | return new ClientHyperLogLogProxy("ClientHyperLogLogProxy", HyperLogLogService.SERVICE_NAME, s); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/ResetBackupOperation.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogBaseOperation.java
// public abstract class HyperLogLogBaseOperation extends Operation implements PartitionAwareOperation, IdentifiedDataSerializable {
//
// protected String name;
//
// public HyperLogLogBaseOperation() {
// }
//
//... | import com.hazelcast.spi.BackupOperation;
import org.rakam.cache.hazelcast.hyperloglog.HyperLogLogBaseOperation;
import org.rakam.util.HLLWrapper; | package org.rakam.cache.hazelcast.hyperloglog.operations;
/**
* Created by buremba <Burak Emre Kabakcı> on 11/07/14 16:16.
*/
public class ResetBackupOperation extends HyperLogLogBaseOperation implements BackupOperation {
public ResetBackupOperation() {
}
public ResetBackupOperation(String name) {
... | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogBaseOperation.java
// public abstract class HyperLogLogBaseOperation extends Operation implements PartitionAwareOperation, IdentifiedDataSerializable {
//
// protected String name;
//
// public HyperLogLogBaseOperation() {
// }
//
//... | HLLWrapper hll = getHLL(); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogBaseOperation.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/HyperLogLogSerializerFactory.java
// public final class HyperLogLogSerializerFactory implements DataSerializableFactory {
//
// public static final int F_ID = 100;
//
// public static final int ADD = 0;
// public static final int ADD_... | import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
import com.hazelcast.spi.Operation;
import com.hazelcast.spi.PartitionAwareOperation;
import org.rakam.cache.hazelcast.hyperloglog.operations.HyperLogLogSerializerFacto... | /**
* Created by buremba <Burak Emre Kabakcı> on 10/07/14.
*/
package org.rakam.cache.hazelcast.hyperloglog;
public abstract class HyperLogLogBaseOperation extends Operation implements PartitionAwareOperation, IdentifiedDataSerializable {
protected String name;
public HyperLogLogBaseOperation() {
}
... | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/HyperLogLogSerializerFactory.java
// public final class HyperLogLogSerializerFactory implements DataSerializableFactory {
//
// public static final int F_ID = 100;
//
// public static final int ADD = 0;
// public static final int ADD_... | public HLLWrapper getHLL() { |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogBaseOperation.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/HyperLogLogSerializerFactory.java
// public final class HyperLogLogSerializerFactory implements DataSerializableFactory {
//
// public static final int F_ID = 100;
//
// public static final int ADD = 0;
// public static final int ADD_... | import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.nio.serialization.IdentifiedDataSerializable;
import com.hazelcast.spi.Operation;
import com.hazelcast.spi.PartitionAwareOperation;
import org.rakam.cache.hazelcast.hyperloglog.operations.HyperLogLogSerializerFacto... | /**
* Created by buremba <Burak Emre Kabakcı> on 10/07/14.
*/
package org.rakam.cache.hazelcast.hyperloglog;
public abstract class HyperLogLogBaseOperation extends Operation implements PartitionAwareOperation, IdentifiedDataSerializable {
protected String name;
public HyperLogLogBaseOperation() {
}
... | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/HyperLogLogSerializerFactory.java
// public final class HyperLogLogSerializerFactory implements DataSerializableFactory {
//
// public static final int F_ID = 100;
//
// public static final int ADD = 0;
// public static final int ADD_... | return HyperLogLogSerializerFactory.F_ID; |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogProxy.java | // Path: src/main/java/org/rakam/util/HLLWrapper.java
// public class HLLWrapper {
// final private static int SEED = 123456;
// private HLL hll;
//
// public HLLWrapper() {
// hll = new HLL(13/*log2m*/, 5/*registerWidth*/);
// }
//
// public HLLWrapper(byte[] bytes) {
// hll = HLL... | import com.hazelcast.spi.*;
import com.hazelcast.util.ExceptionUtil;
import org.rakam.cache.hazelcast.hyperloglog.operations.*;
import org.rakam.util.HLLWrapper;
import java.util.Collection; | public String getServiceName() {
return HyperLogLogService.SERVICE_NAME;
}
@Override
public String toString() {
return "HyperLogLog{" + "name='" + name + '\'' + '}';
}
@Override
public String getName() {
return name;
}
@Override
public long cardinality(... | // Path: src/main/java/org/rakam/util/HLLWrapper.java
// public class HLLWrapper {
// final private static int SEED = 123456;
// private HLL hll;
//
// public HLLWrapper() {
// hll = new HLL(13/*log2m*/, 5/*registerWidth*/);
// }
//
// public HLLWrapper(byte[] bytes) {
// hll = HLL... | public void union(HLLWrapper hll) { |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/treemap/operations/IncrementByBackupOperation.java | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/OrderedCounterMap.java
// public class OrderedCounterMap implements Iterable<Counter>, DataSerializable {
// Set<Counter> set = Collections.newSetFromMap(new ConcurrentSkipListMap());
// Map<String, Counter> map = new ConcurrentHashMap<String, Counter>();... | import com.hazelcast.spi.BackupOperation;
import org.rakam.cache.hazelcast.treemap.OrderedCounterMap;
import org.rakam.cache.hazelcast.treemap.TreeMapService; | package org.rakam.cache.hazelcast.treemap.operations;
/**
* Created by buremba <Burak Emre Kabakcı> on 15/07/14 03:23.
*/
public class IncrementByBackupOperation extends TreeMapBaseOperation implements BackupOperation {
private long by;
public IncrementByBackupOperation(String name, long by) {
supe... | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/OrderedCounterMap.java
// public class OrderedCounterMap implements Iterable<Counter>, DataSerializable {
// Set<Counter> set = Collections.newSetFromMap(new ConcurrentSkipListMap());
// Map<String, Counter> map = new ConcurrentHashMap<String, Counter>();... | OrderedCounterMap map = ((TreeMapService) getService()).getHLL(name); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/treemap/operations/IncrementByBackupOperation.java | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/OrderedCounterMap.java
// public class OrderedCounterMap implements Iterable<Counter>, DataSerializable {
// Set<Counter> set = Collections.newSetFromMap(new ConcurrentSkipListMap());
// Map<String, Counter> map = new ConcurrentHashMap<String, Counter>();... | import com.hazelcast.spi.BackupOperation;
import org.rakam.cache.hazelcast.treemap.OrderedCounterMap;
import org.rakam.cache.hazelcast.treemap.TreeMapService; | package org.rakam.cache.hazelcast.treemap.operations;
/**
* Created by buremba <Burak Emre Kabakcı> on 15/07/14 03:23.
*/
public class IncrementByBackupOperation extends TreeMapBaseOperation implements BackupOperation {
private long by;
public IncrementByBackupOperation(String name, long by) {
supe... | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/OrderedCounterMap.java
// public class OrderedCounterMap implements Iterable<Counter>, DataSerializable {
// Set<Counter> set = Collections.newSetFromMap(new ConcurrentSkipListMap());
// Map<String, Counter> map = new ConcurrentHashMap<String, Counter>();... | OrderedCounterMap map = ((TreeMapService) getService()).getHLL(name); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/treemap/TreeMapProxy.java | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/operations/GetOperation.java
// public class GetOperation extends TreeMapBaseOperation {
// private Integer numberOfElements = null;
// private Map<String, Long> returnValue;
//
// public GetOperation(String name) {
// super(name);
// }
/... | import com.hazelcast.spi.*;
import com.hazelcast.util.ExceptionUtil;
import org.rakam.cache.hazelcast.treemap.operations.GetOperation;
import org.rakam.cache.hazelcast.treemap.operations.IncrementByOperation;
import java.util.Map; | try {
OperationService operationService = getNodeEngine().getOperationService();
return (InternalCompletableFuture<E>) operationService.invokeOnPartition(
TreeMapService.SERVICE_NAME, operation, partitionId);
} catch (Throwable throwable) {
throw E... | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/operations/GetOperation.java
// public class GetOperation extends TreeMapBaseOperation {
// private Integer numberOfElements = null;
// private Map<String, Long> returnValue;
//
// public GetOperation(String name) {
// super(name);
// }
/... | Operation operation = new IncrementByOperation(name, key, by); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/treemap/TreeMapProxy.java | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/operations/GetOperation.java
// public class GetOperation extends TreeMapBaseOperation {
// private Integer numberOfElements = null;
// private Map<String, Long> returnValue;
//
// public GetOperation(String name) {
// super(name);
// }
/... | import com.hazelcast.spi.*;
import com.hazelcast.util.ExceptionUtil;
import org.rakam.cache.hazelcast.treemap.operations.GetOperation;
import org.rakam.cache.hazelcast.treemap.operations.IncrementByOperation;
import java.util.Map; | }
}
@Override
public String getServiceName() {
return TreeMapService.SERVICE_NAME;
}
@Override
public String toString() {
return "Map{" + "name='" + name + '\'' + '}';
}
@Override
public String getName() {
return name;
}
@Override
publi... | // Path: src/main/java/org/rakam/cache/hazelcast/treemap/operations/GetOperation.java
// public class GetOperation extends TreeMapBaseOperation {
// private Integer numberOfElements = null;
// private Map<String, Long> returnValue;
//
// public GetOperation(String name) {
// super(name);
// }
/... | Operation operation = new GetOperation(name); |
buremba/hazelcast-modules | src/main/java/org/rakam/cache/hazelcast/hyperloglog/operations/AddAllOperation.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogBackupAwareOperation.java
// public abstract class HyperLogLogBackupAwareOperation extends HyperLogLogBaseOperation implements BackupAwareOperation, BackupOperation {
//
// protected boolean shouldBackup = true;
//
// public HyperLogLogBa... | import com.hazelcast.nio.ObjectDataInput;
import com.hazelcast.nio.ObjectDataOutput;
import com.hazelcast.spi.Operation;
import org.rakam.cache.hazelcast.hyperloglog.HyperLogLogBackupAwareOperation;
import org.rakam.util.HLLWrapper;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Collection; | /**
* Created by buremba on 10/07/14.
*/
package org.rakam.cache.hazelcast.hyperloglog.operations;
public class AddAllOperation extends HyperLogLogBackupAwareOperation {
private Collection<String> items;
public AddAllOperation() {
}
public AddAllOperation(String name, Collection<String> item) {... | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/HyperLogLogBackupAwareOperation.java
// public abstract class HyperLogLogBackupAwareOperation extends HyperLogLogBaseOperation implements BackupAwareOperation, BackupOperation {
//
// protected boolean shouldBackup = true;
//
// public HyperLogLogBa... | HLLWrapper hll = getHLL(); |
buremba/hazelcast-modules | src/main/java/org/rakam/util/HLLWrapper.java | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/MurmurHash3.java
// public final class MurmurHash3 {
//
// private MurmurHash3() {
// }
//
// /**
// * Returns the MurmurHash3_x86_32 hash.
// */
// public static int murmurhash3x8632(byte[] data, int offset, int len, int seed) {
/... | import java.util.Collection;
import net.agkn.hll.HLL;
import org.rakam.cache.hazelcast.hyperloglog.MurmurHash3; | /**
* Created by buremba <Burak Emre Kabakcı> on 10/07/14.
*/
package org.rakam.util;
public class HLLWrapper {
final private static int SEED = 123456;
private HLL hll;
public HLLWrapper() {
hll = new HLL(13/*log2m*/, 5/*registerWidth*/);
}
public HLLWrapper(byte[] bytes) {
h... | // Path: src/main/java/org/rakam/cache/hazelcast/hyperloglog/MurmurHash3.java
// public final class MurmurHash3 {
//
// private MurmurHash3() {
// }
//
// /**
// * Returns the MurmurHash3_x86_32 hash.
// */
// public static int murmurhash3x8632(byte[] data, int offset, int len, int seed) {
/... | hll.addRaw(MurmurHash3.murmurhash3x8632(s, 0, s.length, SEED)); |
zhanjiashu/ZhihuDialyM | app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/activity/BaseActivity.java | // Path: common/src/main/java/io/gitcafe/zhanjiashu/common/util/DisplayUtils.java
// public class DisplayUtils {
//
// public static int getStatusBarHeight(Context context) {
// int result = 0;
// int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
// ... | import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;
import de.gre... | package io.gitcafe.zhanjiashu.newzhihudialy.activity;
/**
* Created by Jiashu on 2015/5/31.
*/
public class BaseActivity extends AppCompatActivity {
EventBus mEventBus; | // Path: common/src/main/java/io/gitcafe/zhanjiashu/common/util/DisplayUtils.java
// public class DisplayUtils {
//
// public static int getStatusBarHeight(Context context) {
// int result = 0;
// int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
// ... | VolleyUtils mVolleyUtils; |
zhanjiashu/ZhihuDialyM | app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/activity/BaseActivity.java | // Path: common/src/main/java/io/gitcafe/zhanjiashu/common/util/DisplayUtils.java
// public class DisplayUtils {
//
// public static int getStatusBarHeight(Context context) {
// int result = 0;
// int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
// ... | import android.os.Build;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.view.ViewGroup;
import android.view.WindowManager;
import android.widget.LinearLayout;
import android.widget.TextView;
import de.gre... | package io.gitcafe.zhanjiashu.newzhihudialy.activity;
/**
* Created by Jiashu on 2015/5/31.
*/
public class BaseActivity extends AppCompatActivity {
EventBus mEventBus;
VolleyUtils mVolleyUtils;
FragmentManager mFragmentManager;
@Override
protected void onCreate(Bundle savedInstanceState) {
... | // Path: common/src/main/java/io/gitcafe/zhanjiashu/common/util/DisplayUtils.java
// public class DisplayUtils {
//
// public static int getStatusBarHeight(Context context) {
// int result = 0;
// int resourceId = context.getResources().getIdentifier("status_bar_height", "dimen", "android");
// ... | DisplayUtils.getStatusBarHeight(BaseActivity.this)); |
zhanjiashu/ZhihuDialyM | app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/util/ZHStorageUtils.java | // Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/app/App.java
// public class App extends Application {
//
// private static final String TAG = "AppApplication";
// private static Context mContext;
//
// @Override
// public void onCreate() {
// super.onCreate();
// mConte... | import android.content.Context;
import android.os.Environment;
import android.text.TextUtils;
import com.jakewharton.disklrucache.DiskLruCache;
import com.nostra13.universalimageloader.utils.L;
import java.io.File;
import java.io.IOException;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmExcep... | package io.gitcafe.zhanjiashu.newzhihudialy.util;
/**
* Created by Jiashu on 2015/6/3.
*/
public class ZHStorageUtils {
private static DiskLruCache mFilesDiskCache;
public static File getDiskCacheDir(Context context, String dir) {
if (Environment.MEDIA_MOUNTED.equals(Environment.getExternalStor... | // Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/app/App.java
// public class App extends Application {
//
// private static final String TAG = "AppApplication";
// private static Context mContext;
//
// @Override
// public void onCreate() {
// super.onCreate();
// mConte... | mFilesDiskCache = DiskLruCache.open(cacheDir, App.getAppVersion(context), 1, 30 * 1024 * 1024); |
zhanjiashu/ZhihuDialyM | app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/util/VolleyUtils.java | // Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/app/App.java
// public class App extends Application {
//
// private static final String TAG = "AppApplication";
// private static Context mContext;
//
// @Override
// public void onCreate() {
// super.onCreate();
// mConte... | import android.content.Context;
import android.graphics.Bitmap;
import android.util.LruCache;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
import io.gitcafe.zhanjiashu.newzhihudialy.app.App;
import io.... | package io.gitcafe.zhanjiashu.newzhihudialy.util;
/**
* Created by Jiashu on 2015/5/31.
*/
public class VolleyUtils {
private static VolleyUtils mInstance;
private RequestQueue mRequestQueue;
private ImageLoader mImageLoader;
private VolleyUtils(Context context) {
mRequestQueue = getReque... | // Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/app/App.java
// public class App extends Application {
//
// private static final String TAG = "AppApplication";
// private static Context mContext;
//
// @Override
// public void onCreate() {
// super.onCreate();
// mConte... | mImageLoader = new ImageLoader(mRequestQueue, new VolleyLruImageCache(context)); |
zhanjiashu/ZhihuDialyM | app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/util/VolleyUtils.java | // Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/app/App.java
// public class App extends Application {
//
// private static final String TAG = "AppApplication";
// private static Context mContext;
//
// @Override
// public void onCreate() {
// super.onCreate();
// mConte... | import android.content.Context;
import android.graphics.Bitmap;
import android.util.LruCache;
import com.android.volley.Request;
import com.android.volley.RequestQueue;
import com.android.volley.toolbox.ImageLoader;
import com.android.volley.toolbox.Volley;
import io.gitcafe.zhanjiashu.newzhihudialy.app.App;
import io.... | package io.gitcafe.zhanjiashu.newzhihudialy.util;
/**
* Created by Jiashu on 2015/5/31.
*/
public class VolleyUtils {
private static VolleyUtils mInstance;
private RequestQueue mRequestQueue;
private ImageLoader mImageLoader;
private VolleyUtils(Context context) {
mRequestQueue = getReque... | // Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/app/App.java
// public class App extends Application {
//
// private static final String TAG = "AppApplication";
// private static Context mContext;
//
// @Override
// public void onCreate() {
// super.onCreate();
// mConte... | mRequestQueue = Volley.newRequestQueue(App.getContext()); |
zhanjiashu/ZhihuDialyM | app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/app/App.java | // Path: common/src/main/java/io/gitcafe/zhanjiashu/common/util/LogUtil.java
// public class LogUtil {
// public static final int VERBOSE = 1;
// public static final int DEBUG = 2;
// public static final int INFO = 3;
// public static final int WARN = 4;
// public static final int ERROR = 5;
// ... | import android.app.Application;
import android.content.Context;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import com.nostra13.universalimageloader.cache.disc.impl.UnlimitedDiskCache;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloade... | package io.gitcafe.zhanjiashu.newzhihudialy.app;
/**
* Created by Jiashu on 2015/5/31.
*/
public class App extends Application {
private static final String TAG = "AppApplication";
private static Context mContext;
@Override
public void onCreate() {
super.onCreate();
mContext = t... | // Path: common/src/main/java/io/gitcafe/zhanjiashu/common/util/LogUtil.java
// public class LogUtil {
// public static final int VERBOSE = 1;
// public static final int DEBUG = 2;
// public static final int INFO = 3;
// public static final int WARN = 4;
// public static final int ERROR = 5;
// ... | LogUtil.d(TAG, "App reset"); |
zhanjiashu/ZhihuDialyM | app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/task/FetchLatestDialyTask.java | // Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/model/DialyEntity.java
// public class DialyEntity {
//
// private String date;
// private List<StoryEntity> stories;
//
// public void setDate(String date) {
// this.date = date;
// }
//
// public void setStories(List<StoryEn... | import android.content.Context;
import com.google.gson.Gson;
import io.gitcafe.zhanjiashu.newzhihudialy.model.DialyEntity;
import io.gitcafe.zhanjiashu.newzhihudialy.model.LatestDialyEntity; | package io.gitcafe.zhanjiashu.newzhihudialy.task;
/**
* Created by Jiashu on 2015/6/7.
*/
public class FetchLatestDialyTask extends FetchTask<DialyEntity> {
public static final String URL_LATEST = "http://news-at.zhihu.com/api/4/stories/latest";
public FetchLatestDialyTask(Context context) {
thi... | // Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/model/DialyEntity.java
// public class DialyEntity {
//
// private String date;
// private List<StoryEntity> stories;
//
// public void setDate(String date) {
// this.date = date;
// }
//
// public void setStories(List<StoryEn... | LatestDialyEntity entity = new Gson().fromJson(response, LatestDialyEntity.class); |
zhanjiashu/ZhihuDialyM | app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/activity/SettingsActivity.java | // Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/fragment/SettingsFragment.java
// public class SettingsFragment extends PreferenceFragment implements Preference.OnPreferenceClickListener {
//
// private final String TAG = getClass().getSimpleName();
//
// public static final String CLEAR_CACHE ... | import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.widget.Toolbar;
import android.view.MenuItem;
import butterknife.ButterKnife;
import butterknife.InjectView;
import io.gitcafe.zhanjiashu.newzhihudialy.R;
import io.gitcafe.zhanjiashu.newzhihudialy.fragment.SettingsFragment; | package io.gitcafe.zhanjiashu.newzhihudialy.activity;
public class SettingsActivity extends BaseActivity {
@InjectView(R.id.toolbar)
Toolbar mToolbar;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_... | // Path: app/src/main/java/io/gitcafe/zhanjiashu/newzhihudialy/fragment/SettingsFragment.java
// public class SettingsFragment extends PreferenceFragment implements Preference.OnPreferenceClickListener {
//
// private final String TAG = getClass().getSimpleName();
//
// public static final String CLEAR_CACHE ... | .replace(R.id.fl_container, new SettingsFragment()) |
numenta/htm.java | src/test/java/org/numenta/nupic/network/ManualInputTest.java | // Path: src/main/java/org/numenta/nupic/model/Cell.java
// public class Cell implements Comparable<Cell>, Serializable {
// /** keep it simple */
// private static final long serialVersionUID = 1L;
//
// /** This cell's index */
// private final int index;
// /** Remove boxing where necessary ... | import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import java.util.Arrays;
import java.util.HashMap;
import java.util.LinkedHashSet;
import java.util.Set;
import org.junit.Test;
import org.numenta.nupic.algorithms.Classification;
import o... | package org.numenta.nupic.network;
public class ManualInputTest {
/**
* ManualInput retVal = new ManualInput();
retVal.classifierInput = new HashMap<String, NamedTuple>(this.classifierInput);
retVal.classifiers = this.classifiers;
retVal.layerInput = this.layerInput;
retVa... | // Path: src/main/java/org/numenta/nupic/model/Cell.java
// public class Cell implements Comparable<Cell>, Serializable {
// /** keep it simple */
// private static final long serialVersionUID = 1L;
//
// /** This cell's index */
// private final int index;
// /** Remove boxing where necessary ... | Set<Cell> activeCells = new LinkedHashSet<>(); activeCells.add(new Cell(new Column(4, 0), 1)); |
mp911de/spinach | src/main/java/biz/paluch/spinach/api/sync/DisqueCommands.java | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | import java.util.concurrent.TimeUnit;
import biz.paluch.spinach.api.DisqueConnection; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | DisqueConnection<K, V> getConnection(); |
mp911de/spinach | src/main/java/biz/paluch/spinach/api/async/DisqueServerAsyncCommands.java | // Path: src/main/java/biz/paluch/spinach/api/CommandType.java
// public enum CommandType implements ProtocolKeyword {
// // Jobs
// ADDJOB, ACKJOB, DELJOB, FASTACK, GETJOB, JSCAN, SHOW,
//
// // Queues
// ENQUEUE, DEQUEUE, NACK, PAUSE, QLEN, QPEEK, QSCAN, QSTAT, WORKING,
//
// // AOF
// BGREW... | import java.util.List;
import biz.paluch.spinach.api.CommandType;
import com.lambdaworks.redis.KillArgs;
import com.lambdaworks.redis.RedisFuture; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/CommandType.java
// public enum CommandType implements ProtocolKeyword {
// // Jobs
// ADDJOB, ACKJOB, DELJOB, FASTACK, GETJOB, JSCAN, SHOW,
//
// // Queues
// ENQUEUE, DEQUEUE, NACK, PAUSE, QLEN, QPEEK, QSCAN, QSTAT, WORKING,
//
// // AOF
// BGREW... | RedisFuture<List<Object>> commandInfo(CommandType... commands); |
mp911de/spinach | src/main/java/biz/paluch/spinach/impl/HelloClusterSocketAddressSupplier.java | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | import java.net.InetSocketAddress;
import java.net.SocketAddress;
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.cluster.DisqueNode; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | protected RoundRobin<DisqueNode> roundRobin; |
mp911de/spinach | src/test/java/biz/paluch/spinach/impl/DisqueCommandTest.java | // Path: src/main/java/biz/paluch/spinach/api/CommandKeyword.java
// public enum CommandKeyword implements ProtocolKeyword {
//
// ALL, ASYNC, BCAST, BLOCKING, BUSYLOOP, COUNT, DELAY, FLUSHALL, FORGET, FROM, GET, HARD, ID, IMPORTRATE, IN, LEAVING,
//
// MAXLEN, MEET, MINLEN, NODES, NOHANG, NONE, OUT, QUEUE, R... | import static org.assertj.core.api.Assertions.assertThat;
import java.nio.ByteBuffer;
import java.util.concurrent.ExecutionException;
import com.lambdaworks.redis.codec.Utf8StringCodec;
import com.lambdaworks.redis.protocol.AsyncCommand;
import org.junit.After;
import org.junit.Test;
import biz.paluch.spinach.api.Comma... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/CommandKeyword.java
// public enum CommandKeyword implements ProtocolKeyword {
//
// ALL, ASYNC, BCAST, BLOCKING, BUSYLOOP, COUNT, DELAY, FLUSHALL, FORGET, FROM, GET, HARD, ID, IMPORTRATE, IN, LEAVING,
//
// MAXLEN, MEET, MINLEN, NODES, NOHANG, NONE, OUT, QUEUE, R... | private DisqueCommand<String, String, String> command = new DisqueCommand<String, String, String>(CommandKeyword.GET, |
mp911de/spinach | src/main/java/biz/paluch/spinach/cluster/GetJobsAction.java | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | import java.lang.reflect.Field;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Supplier;
import rx.Subscriber;
import rx.Subscription;
import rx.functions.Acti... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | private final DisqueConnection<K, V> disqueConnection; |
mp911de/spinach | src/main/java/biz/paluch/spinach/cluster/GetJobsAction.java | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | import java.lang.reflect.Field;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.ReentrantLock;
import java.util.function.Supplier;
import rx.Subscriber;
import rx.Subscription;
import rx.functions.Acti... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | private final Subscriber<? super Job<K, V>> subscriber; |
mp911de/spinach | src/main/java/biz/paluch/spinach/cluster/NodeIdAwareSocketAddressSupplier.java | // Path: src/main/java/biz/paluch/spinach/impl/HelloClusterSocketAddressSupplier.java
// public class HelloClusterSocketAddressSupplier extends ClusterAwareNodeSupport implements SocketAddressSupplier,
// ConnectionAware {
//
// protected final SocketAddressSupplier bootstrap;
// protected RoundRobin<D... | import java.net.InetSocketAddress;
import java.net.SocketAddress;
import com.lambdaworks.redis.internal.LettuceAssert;
import biz.paluch.spinach.impl.HelloClusterSocketAddressSupplier;
import biz.paluch.spinach.impl.RoundRobin;
import biz.paluch.spinach.impl.SocketAddressSupplier; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/impl/HelloClusterSocketAddressSupplier.java
// public class HelloClusterSocketAddressSupplier extends ClusterAwareNodeSupport implements SocketAddressSupplier,
// ConnectionAware {
//
// protected final SocketAddressSupplier bootstrap;
// protected RoundRobin<D... | public NodeIdAwareSocketAddressSupplier(SocketAddressSupplier bootstrap) { |
mp911de/spinach | src/main/java/biz/paluch/spinach/cluster/NodeIdAwareSocketAddressSupplier.java | // Path: src/main/java/biz/paluch/spinach/impl/HelloClusterSocketAddressSupplier.java
// public class HelloClusterSocketAddressSupplier extends ClusterAwareNodeSupport implements SocketAddressSupplier,
// ConnectionAware {
//
// protected final SocketAddressSupplier bootstrap;
// protected RoundRobin<D... | import java.net.InetSocketAddress;
import java.net.SocketAddress;
import com.lambdaworks.redis.internal.LettuceAssert;
import biz.paluch.spinach.impl.HelloClusterSocketAddressSupplier;
import biz.paluch.spinach.impl.RoundRobin;
import biz.paluch.spinach.impl.SocketAddressSupplier; | /**
* Set the id prefix of the preferred node.
*
* @param preferredNodeIdPrefix the id prefix of the preferred node
*/
public void setPreferredNodeIdPrefix(String preferredNodeIdPrefix) {
LettuceAssert.notNull(preferredNodeIdPrefix, "preferredNodeIdPrefix must not be null");
... | // Path: src/main/java/biz/paluch/spinach/impl/HelloClusterSocketAddressSupplier.java
// public class HelloClusterSocketAddressSupplier extends ClusterAwareNodeSupport implements SocketAddressSupplier,
// ConnectionAware {
//
// protected final SocketAddressSupplier bootstrap;
// protected RoundRobin<D... | roundRobin = new RoundRobin<DisqueNode>(getNodes(), previous); |
mp911de/spinach | src/main/java/biz/paluch/spinach/api/async/DisqueAsyncCommands.java | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | import biz.paluch.spinach.api.DisqueConnection;
import com.lambdaworks.redis.RedisFuture; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | DisqueConnection<K, V> getConnection(); |
mp911de/spinach | src/test/java/biz/paluch/spinach/Example.java | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.api.sync.DisqueCommands; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | DisqueCommands<String, String> connection = disqueClient.connect().sync(); |
mp911de/spinach | src/test/java/biz/paluch/spinach/SyncAsyncApiConvergenceTest.java | // Path: src/main/java/biz/paluch/spinach/api/async/DisqueAsyncCommands.java
// public interface DisqueAsyncCommands<K, V> extends DisqueJobAsyncCommands<K, V>, DisqueQueueAsyncCommands<K, V>,
// DisqueServerAsyncCommands<K, V>, DisqueClusterAsyncCommands<K, V> {
//
// /**
// * Authenticate to the ser... | import static org.assertj.core.api.Assertions.*;
import java.lang.reflect.*;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import biz.paluch.spinach.api.async.DisqueAsyncCommands;
import biz.paluch.spinach.api.sync.Disq... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/async/DisqueAsyncCommands.java
// public interface DisqueAsyncCommands<K, V> extends DisqueJobAsyncCommands<K, V>, DisqueQueueAsyncCommands<K, V>,
// DisqueServerAsyncCommands<K, V>, DisqueClusterAsyncCommands<K, V> {
//
// /**
// * Authenticate to the ser... | private Class<DisqueAsyncCommands> asyncClass = DisqueAsyncCommands.class; |
mp911de/spinach | src/test/java/biz/paluch/spinach/SyncAsyncApiConvergenceTest.java | // Path: src/main/java/biz/paluch/spinach/api/async/DisqueAsyncCommands.java
// public interface DisqueAsyncCommands<K, V> extends DisqueJobAsyncCommands<K, V>, DisqueQueueAsyncCommands<K, V>,
// DisqueServerAsyncCommands<K, V>, DisqueClusterAsyncCommands<K, V> {
//
// /**
// * Authenticate to the ser... | import static org.assertj.core.api.Assertions.*;
import java.lang.reflect.*;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import biz.paluch.spinach.api.async.DisqueAsyncCommands;
import biz.paluch.spinach.api.sync.Disq... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/async/DisqueAsyncCommands.java
// public interface DisqueAsyncCommands<K, V> extends DisqueJobAsyncCommands<K, V>, DisqueQueueAsyncCommands<K, V>,
// DisqueServerAsyncCommands<K, V>, DisqueClusterAsyncCommands<K, V> {
//
// /**
// * Authenticate to the ser... | Method[] methods = DisqueCommands.class.getMethods(); |
mp911de/spinach | src/test/java/biz/paluch/spinach/commands/rx/RxSyncInvocationHandler.java | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
import java.util.Iterator;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import com.lambdaworks.redis.internal.AbstractInvocationHandler;
import com.lambdaworks.redis.inter... | Object result = targetMethod.invoke(rxApi, args);
if (result == null || !(result instanceof Observable<?>)) {
return result;
}
Observable<?> observable = (Observable<?>) result;
Iterable<?> objects = observable.toBlocking().toIterable();
... | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | public static <K, V> DisqueCommands<K, V> sync(DisqueConnection<K, V> connection) { |
mp911de/spinach | src/test/java/biz/paluch/spinach/ClientMetricsTest.java | // Path: src/main/java/biz/paluch/spinach/api/sync/DisqueCommands.java
// public interface DisqueCommands<K, V> extends DisqueJobCommands<K, V>, DisqueQueueCommands<K, V>, DisqueServerCommands<K, V>,
// DisqueClusterCommands<K, V> {
//
// /**
// * Authenticate to the server.
// *
// * @param... | import static com.google.code.tempusfugit.temporal.Duration.seconds;
import static com.google.code.tempusfugit.temporal.Timeout.timeout;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.test.util.ReflectionTestUt... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/sync/DisqueCommands.java
// public interface DisqueCommands<K, V> extends DisqueJobCommands<K, V>, DisqueQueueCommands<K, V>, DisqueServerCommands<K, V>,
// DisqueClusterCommands<K, V> {
//
// /**
// * Authenticate to the server.
// *
// * @param... | private DisqueCommands<String, String> disque; |
mp911de/spinach | src/test/java/biz/paluch/spinach/ClientMetricsTest.java | // Path: src/main/java/biz/paluch/spinach/api/sync/DisqueCommands.java
// public interface DisqueCommands<K, V> extends DisqueJobCommands<K, V>, DisqueQueueCommands<K, V>, DisqueServerCommands<K, V>,
// DisqueClusterCommands<K, V> {
//
// /**
// * Authenticate to the server.
// *
// * @param... | import static com.google.code.tempusfugit.temporal.Duration.seconds;
import static com.google.code.tempusfugit.temporal.Timeout.timeout;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.springframework.test.util.ReflectionTestUt... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/sync/DisqueCommands.java
// public interface DisqueCommands<K, V> extends DisqueJobCommands<K, V>, DisqueQueueCommands<K, V>, DisqueServerCommands<K, V>,
// DisqueClusterCommands<K, V> {
//
// /**
// * Authenticate to the server.
// *
// * @param... | FastShutdown.shutdown(disqueClient); |
mp911de/spinach | src/test/java/biz/paluch/spinach/SslTest.java | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int sslPort() {
// return Integer.valueOf(System.getProperty("sslport", "7443"));
... | import com.lambdaworks.redis.ClientOptions;
import com.lambdaworks.redis.JavaRuntime;
import com.lambdaworks.redis.RedisConnectionException;
import com.lambdaworks.redis.resource.ClientResources;
import static biz.paluch.spinach.TestSettings.host;
import static biz.paluch.spinach.TestSettings.sslPort;
import static org... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int sslPort() {
// return Integer.valueOf(System.getProperty("sslport", "7443"));
... | public static ClientResources clientResources = DefaultDisqueClient.getClientResources(); |
mp911de/spinach | src/test/java/biz/paluch/spinach/SslTest.java | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int sslPort() {
// return Integer.valueOf(System.getProperty("sslport", "7443"));
... | import com.lambdaworks.redis.ClientOptions;
import com.lambdaworks.redis.JavaRuntime;
import com.lambdaworks.redis.RedisConnectionException;
import com.lambdaworks.redis.resource.ClientResources;
import static biz.paluch.spinach.TestSettings.host;
import static biz.paluch.spinach.TestSettings.sslPort;
import static org... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int sslPort() {
// return Integer.valueOf(System.getProperty("sslport", "7443"));
... | assumeTrue("Assume that stunnel runs on port 7443", Sockets.isOpen(host(), sslPort())); |
mp911de/spinach | src/test/java/biz/paluch/spinach/SslTest.java | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int sslPort() {
// return Integer.valueOf(System.getProperty("sslport", "7443"));
... | import com.lambdaworks.redis.ClientOptions;
import com.lambdaworks.redis.JavaRuntime;
import com.lambdaworks.redis.RedisConnectionException;
import com.lambdaworks.redis.resource.ClientResources;
import static biz.paluch.spinach.TestSettings.host;
import static biz.paluch.spinach.TestSettings.sslPort;
import static org... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int sslPort() {
// return Integer.valueOf(System.getProperty("sslport", "7443"));
... | assumeTrue("Assume that stunnel runs on port 7443", Sockets.isOpen(host(), sslPort())); |
mp911de/spinach | src/test/java/biz/paluch/spinach/SslTest.java | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int sslPort() {
// return Integer.valueOf(System.getProperty("sslport", "7443"));
... | import com.lambdaworks.redis.ClientOptions;
import com.lambdaworks.redis.JavaRuntime;
import com.lambdaworks.redis.RedisConnectionException;
import com.lambdaworks.redis.resource.ClientResources;
import static biz.paluch.spinach.TestSettings.host;
import static biz.paluch.spinach.TestSettings.sslPort;
import static org... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int sslPort() {
// return Integer.valueOf(System.getProperty("sslport", "7443"));
... | FastShutdown.shutdown(disqueClient); |
mp911de/spinach | src/test/java/biz/paluch/spinach/SslTest.java | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int sslPort() {
// return Integer.valueOf(System.getProperty("sslport", "7443"));
... | import com.lambdaworks.redis.ClientOptions;
import com.lambdaworks.redis.JavaRuntime;
import com.lambdaworks.redis.RedisConnectionException;
import com.lambdaworks.redis.resource.ClientResources;
import static biz.paluch.spinach.TestSettings.host;
import static biz.paluch.spinach.TestSettings.sslPort;
import static org... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int sslPort() {
// return Integer.valueOf(System.getProperty("sslport", "7443"));
... | DisqueCommands<String, String> connection = disqueClient.connect(disqueUri).sync(); |
mp911de/spinach | src/test/java/biz/paluch/spinach/RoundRobinSocketAddressSupplierTest.java | // Path: src/main/java/biz/paluch/spinach/impl/RoundRobinSocketAddressSupplier.java
// public class RoundRobinSocketAddressSupplier implements SocketAddressSupplier {
//
// protected final Collection<? extends ConnectionPoint> connectionPoint;
// protected RoundRobin<? extends ConnectionPoint> roundRobin;
//
... | import static org.assertj.core.api.Assertions.assertThat;
import java.net.InetSocketAddress;
import java.util.Arrays;
import java.util.Collection;
import org.junit.Test;
import biz.paluch.spinach.impl.RoundRobinSocketAddressSupplier; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/impl/RoundRobinSocketAddressSupplier.java
// public class RoundRobinSocketAddressSupplier implements SocketAddressSupplier {
//
// protected final Collection<? extends ConnectionPoint> connectionPoint;
// protected RoundRobin<? extends ConnectionPoint> roundRobin;
//
... | RoundRobinSocketAddressSupplier sut = new RoundRobinSocketAddressSupplier(points, null); |
mp911de/spinach | src/main/java/biz/paluch/spinach/api/rx/DisqueServerReactiveCommands.java | // Path: src/main/java/biz/paluch/spinach/api/CommandType.java
// public enum CommandType implements ProtocolKeyword {
// // Jobs
// ADDJOB, ACKJOB, DELJOB, FASTACK, GETJOB, JSCAN, SHOW,
//
// // Queues
// ENQUEUE, DEQUEUE, NACK, PAUSE, QLEN, QPEEK, QSCAN, QSTAT, WORKING,
//
// // AOF
// BGREW... | import biz.paluch.spinach.api.CommandType;
import com.lambdaworks.redis.KillArgs;
import rx.Observable; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/CommandType.java
// public enum CommandType implements ProtocolKeyword {
// // Jobs
// ADDJOB, ACKJOB, DELJOB, FASTACK, GETJOB, JSCAN, SHOW,
//
// // Queues
// ENQUEUE, DEQUEUE, NACK, PAUSE, QLEN, QPEEK, QSCAN, QSTAT, WORKING,
//
// // AOF
// BGREW... | Observable<Object> commandInfo(CommandType... commands); |
mp911de/spinach | src/test/java/biz/paluch/spinach/commands/ServerCommandTest.java | // Path: src/main/java/biz/paluch/spinach/api/CommandType.java
// public enum CommandType implements ProtocolKeyword {
// // Jobs
// ADDJOB, ACKJOB, DELJOB, FASTACK, GETJOB, JSCAN, SHOW,
//
// // Queues
// ENQUEUE, DEQUEUE, NACK, PAUSE, QLEN, QPEEK, QSCAN, QSTAT, WORKING,
//
// // AOF
// BGREW... | import com.lambdaworks.redis.models.command.CommandDetailParser;
import static org.assertj.core.api.Assertions.assertThat;
import static org.hamcrest.CoreMatchers.*;
import static org.junit.Assert.assertThat;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.junit.Ignore;... |
@Test(expected = RedisCommandExecutionException.class)
public void clientKillUnknown() throws Exception {
disque.clientKill("afdsfads");
}
@Test
public void clientList() throws Exception {
assertThat(disque.clientList().contains("addr=")).isTrue();
}
@Test
public void ... | // Path: src/main/java/biz/paluch/spinach/api/CommandType.java
// public enum CommandType implements ProtocolKeyword {
// // Jobs
// ADDJOB, ACKJOB, DELJOB, FASTACK, GETJOB, JSCAN, SHOW,
//
// // Queues
// ENQUEUE, DEQUEUE, NACK, PAUSE, QLEN, QPEEK, QSCAN, QSTAT, WORKING,
//
// // AOF
// BGREW... | List<Object> result = disque.commandInfo(CommandType.ACKJOB); |
mp911de/spinach | src/test/java/biz/paluch/spinach/ClusterConnectionTest.java | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int port() {
// return Integer.valueOf(System.getProperty("port", "7711"));
// }
/... | import static biz.paluch.spinach.TestSettings.host;
import static biz.paluch.spinach.TestSettings.port;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.su... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int port() {
// return Integer.valueOf(System.getProperty("port", "7711"));
// }
/... | DisqueURI disqueURI = new DisqueURI.Builder().withDisque(host(), port()).withDisque(host(), port(1)).build(); |
mp911de/spinach | src/test/java/biz/paluch/spinach/ClusterConnectionTest.java | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int port() {
// return Integer.valueOf(System.getProperty("port", "7711"));
// }
/... | import static biz.paluch.spinach.TestSettings.host;
import static biz.paluch.spinach.TestSettings.port;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.su... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int port() {
// return Integer.valueOf(System.getProperty("port", "7711"));
// }
/... | DisqueURI disqueURI = new DisqueURI.Builder().withDisque(host(), port()).withDisque(host(), port(1)).build(); |
mp911de/spinach | src/test/java/biz/paluch/spinach/ClusterConnectionTest.java | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int port() {
// return Integer.valueOf(System.getProperty("port", "7711"));
// }
/... | import static biz.paluch.spinach.TestSettings.host;
import static biz.paluch.spinach.TestSettings.port;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.su... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int port() {
// return Integer.valueOf(System.getProperty("port", "7711"));
// }
/... | disqueClient = DisqueClient.create(DefaultDisqueClient.getClientResources(), disqueURI); |
mp911de/spinach | src/test/java/biz/paluch/spinach/ClusterConnectionTest.java | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int port() {
// return Integer.valueOf(System.getProperty("port", "7711"));
// }
/... | import static biz.paluch.spinach.TestSettings.host;
import static biz.paluch.spinach.TestSettings.port;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.su... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int port() {
// return Integer.valueOf(System.getProperty("port", "7711"));
// }
/... | FastShutdown.shutdown(disqueClient); |
mp911de/spinach | src/test/java/biz/paluch/spinach/ClusterConnectionTest.java | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int port() {
// return Integer.valueOf(System.getProperty("port", "7711"));
// }
/... | import static biz.paluch.spinach.TestSettings.host;
import static biz.paluch.spinach.TestSettings.port;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.su... | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static String host() {
// return System.getProperty("host", "localhost");
// }
//
// Path: src/test/java/biz/paluch/spinach/TestSettings.java
// public static int port() {
// return Integer.valueOf(System.getProperty("port", "7711"));
// }
/... | DisqueConnection<String, String> connection = disqueClient.connect(); |
mp911de/spinach | src/main/java/biz/paluch/spinach/api/DisqueConnection.java | // Path: src/main/java/biz/paluch/spinach/api/async/DisqueAsyncCommands.java
// public interface DisqueAsyncCommands<K, V> extends DisqueJobAsyncCommands<K, V>, DisqueQueueAsyncCommands<K, V>,
// DisqueServerAsyncCommands<K, V>, DisqueClusterAsyncCommands<K, V> {
//
// /**
// * Authenticate to the ser... | import biz.paluch.spinach.api.async.DisqueAsyncCommands;
import biz.paluch.spinach.api.rx.DisqueReactiveCommands;
import biz.paluch.spinach.api.sync.DisqueCommands;
import com.lambdaworks.redis.api.StatefulConnection; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/async/DisqueAsyncCommands.java
// public interface DisqueAsyncCommands<K, V> extends DisqueJobAsyncCommands<K, V>, DisqueQueueAsyncCommands<K, V>,
// DisqueServerAsyncCommands<K, V>, DisqueClusterAsyncCommands<K, V> {
//
// /**
// * Authenticate to the ser... | DisqueAsyncCommands<K, V> async(); |
mp911de/spinach | src/main/java/biz/paluch/spinach/api/DisqueConnection.java | // Path: src/main/java/biz/paluch/spinach/api/async/DisqueAsyncCommands.java
// public interface DisqueAsyncCommands<K, V> extends DisqueJobAsyncCommands<K, V>, DisqueQueueAsyncCommands<K, V>,
// DisqueServerAsyncCommands<K, V>, DisqueClusterAsyncCommands<K, V> {
//
// /**
// * Authenticate to the ser... | import biz.paluch.spinach.api.async.DisqueAsyncCommands;
import biz.paluch.spinach.api.rx.DisqueReactiveCommands;
import biz.paluch.spinach.api.sync.DisqueCommands;
import com.lambdaworks.redis.api.StatefulConnection; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/async/DisqueAsyncCommands.java
// public interface DisqueAsyncCommands<K, V> extends DisqueJobAsyncCommands<K, V>, DisqueQueueAsyncCommands<K, V>,
// DisqueServerAsyncCommands<K, V>, DisqueClusterAsyncCommands<K, V> {
//
// /**
// * Authenticate to the ser... | DisqueReactiveCommands<K, V> reactive(); |
mp911de/spinach | src/main/java/biz/paluch/spinach/DisqueClient.java | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | import com.lambdaworks.redis.resource.ClientResources;
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.impl.*;
import java.net.ConnectException;
import java.net.InetSocketAddress;
import java.net.SocketAddress;
import java.util.List;
import java.util.concurrent.BlockingQueue;
import java.util.... | * @return a new instance of {@link DisqueClient}
*/
public static DisqueClient create(ClientResources clientResources, String uri) {
assertNotNull(clientResources);
LettuceAssert.notNull(uri, "uri must not be null");
return create(clientResources, DisqueURI.create(uri));
}
... | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | public DisqueConnection<String, String> connect() { |
mp911de/spinach | src/main/java/biz/paluch/spinach/api/rx/DisqueReactiveCommands.java | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | import rx.Observable;
import biz.paluch.spinach.api.DisqueConnection; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | DisqueConnection<K, V> getConnection(); |
mp911de/spinach | src/main/java/biz/paluch/spinach/api/sync/DisqueServerCommands.java | // Path: src/main/java/biz/paluch/spinach/api/CommandType.java
// public enum CommandType implements ProtocolKeyword {
// // Jobs
// ADDJOB, ACKJOB, DELJOB, FASTACK, GETJOB, JSCAN, SHOW,
//
// // Queues
// ENQUEUE, DEQUEUE, NACK, PAUSE, QLEN, QPEEK, QSCAN, QSTAT, WORKING,
//
// // AOF
// BGREW... | import java.util.List;
import biz.paluch.spinach.api.CommandType;
import com.lambdaworks.redis.KillArgs; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/CommandType.java
// public enum CommandType implements ProtocolKeyword {
// // Jobs
// ADDJOB, ACKJOB, DELJOB, FASTACK, GETJOB, JSCAN, SHOW,
//
// // Queues
// ENQUEUE, DEQUEUE, NACK, PAUSE, QLEN, QPEEK, QSCAN, QSTAT, WORKING,
//
// // AOF
// BGREW... | List<Object> commandInfo(CommandType... commands); |
mp911de/spinach | src/main/java/biz/paluch/spinach/cluster/QueueListener.java | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | import java.util.Set;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.function.Supplier;
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.api.Job;
import io.netty.util.internal.ConcurrentSet;
import io.netty.util.internal.logging.Internal... |
if (reconnectTrigger != null) {
reconnectTrigger.unsubscribe();
reconnectTrigger = null;
}
}
/**
* Enable job locality tracking.
*/
void withJobLocalityTracking() {
this.jobLocalityTracking = true;
}
void withNodeSwitching(long nodeReconne... | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | private final DisqueConnection<K, V> connection; |
mp911de/spinach | src/main/java/biz/paluch/spinach/impl/ClusterAwareNodeSupport.java | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | import java.io.Serializable;
import java.util.*;
import com.lambdaworks.redis.internal.LettuceAssert;
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.cluster.DisqueNode; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | private DisqueConnection<Object, Object> disqueConnection; |
mp911de/spinach | src/main/java/biz/paluch/spinach/impl/ClusterAwareNodeSupport.java | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | import java.io.Serializable;
import java.util.*;
import com.lambdaworks.redis.internal.LettuceAssert;
import biz.paluch.spinach.api.DisqueConnection;
import biz.paluch.spinach.cluster.DisqueNode; | /*
* Copyright 2016 the original author or authors.
*
* Licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applica... | // Path: src/main/java/biz/paluch/spinach/api/DisqueConnection.java
// public interface DisqueConnection<K, V> extends StatefulConnection<K, V> {
//
// /**
// * Returns the {@link DisqueCommands} API for the current connection. Does not create a new connection.
// *
// * @return the synchronous API... | private final List<DisqueNode> nodes = new ArrayList<>(); |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/server/Server.java | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | import nl.pvdberg.pnet.event.PNetListener; | /*
* MIT License
*
* Copyright (c) 2017 Pim van den Berg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | void setListener(final PNetListener serverListener); |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/event/ReceiveListener.java | // Path: src/main/java/nl/pvdberg/pnet/client/Client.java
// public interface Client
// {
// /**
// * Sets the event listener
// * @param clientListener Nullable event listener
// */
// void setClientListener(final PNetListener clientListener);
//
// /**
// * Connects to given host:port... | import nl.pvdberg.pnet.client.Client; | /*
* MIT License
*
* Copyright (c) 2017 Pim van den Berg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | // Path: src/main/java/nl/pvdberg/pnet/client/Client.java
// public interface Client
// {
// /**
// * Sets the event listener
// * @param clientListener Nullable event listener
// */
// void setClientListener(final PNetListener clientListener);
//
// /**
// * Connects to given host:port... | public void onConnect(final Client c) |
PvdBerg1998/PNet | src/test/java/nl/pvdberg/pnet/server/util/PlainServerTest.java | // Path: src/main/java/nl/pvdberg/pnet/server/Server.java
// public interface Server
// {
// /**
// * Sets the event listener
// * @param serverListener Nullable event listener
// */
// void setListener(final PNetListener serverListener);
//
// /**
// * Starts the server at given port
/... | import static org.junit.Assert.assertTrue;
import nl.pvdberg.pnet.server.Server;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import static org.junit.Assert.assertFalse; | /*
* MIT License
*
* Copyright (c) 2017 Pim van den Berg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | // Path: src/main/java/nl/pvdberg/pnet/server/Server.java
// public interface Server
// {
// /**
// * Sets the event listener
// * @param serverListener Nullable event listener
// */
// void setListener(final PNetListener serverListener);
//
// /**
// * Starts the server at given port
/... | protected Server server1; |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/event/PacketHandler.java | // Path: src/main/java/nl/pvdberg/pnet/client/Client.java
// public interface Client
// {
// /**
// * Sets the event listener
// * @param clientListener Nullable event listener
// */
// void setClientListener(final PNetListener clientListener);
//
// /**
// * Connects to given host:port... | import nl.pvdberg.pnet.client.Client;
import nl.pvdberg.pnet.packet.Packet;
import java.io.IOException; | /*
* MIT License
*
* Copyright (c) 2017 Pim van den Berg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | // Path: src/main/java/nl/pvdberg/pnet/client/Client.java
// public interface Client
// {
// /**
// * Sets the event listener
// * @param clientListener Nullable event listener
// */
// void setClientListener(final PNetListener clientListener);
//
// /**
// * Connects to given host:port... | void handlePacket(final Packet p, final Client c) throws IOException; |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/event/PacketHandler.java | // Path: src/main/java/nl/pvdberg/pnet/client/Client.java
// public interface Client
// {
// /**
// * Sets the event listener
// * @param clientListener Nullable event listener
// */
// void setClientListener(final PNetListener clientListener);
//
// /**
// * Connects to given host:port... | import nl.pvdberg.pnet.client.Client;
import nl.pvdberg.pnet.packet.Packet;
import java.io.IOException; | /*
* MIT License
*
* Copyright (c) 2017 Pim van den Berg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | // Path: src/main/java/nl/pvdberg/pnet/client/Client.java
// public interface Client
// {
// /**
// * Sets the event listener
// * @param clientListener Nullable event listener
// */
// void setClientListener(final PNetListener clientListener);
//
// /**
// * Connects to given host:port... | void handlePacket(final Packet p, final Client c) throws IOException; |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/event/DistributerListener.java | // Path: src/main/java/nl/pvdberg/pnet/client/Client.java
// public interface Client
// {
// /**
// * Sets the event listener
// * @param clientListener Nullable event listener
// */
// void setClientListener(final PNetListener clientListener);
//
// /**
// * Connects to given host:port... | import nl.pvdberg.pnet.client.Client;
import nl.pvdberg.pnet.packet.Packet;
import java.io.IOException; | /*
* MIT License
*
* Copyright (c) 2017 Pim van den Berg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | // Path: src/main/java/nl/pvdberg/pnet/client/Client.java
// public interface Client
// {
// /**
// * Sets the event listener
// * @param clientListener Nullable event listener
// */
// void setClientListener(final PNetListener clientListener);
//
// /**
// * Connects to given host:port... | public void onConnect(final Client c) |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/factory/ClientFactory.java | // Path: src/main/java/nl/pvdberg/pnet/client/Client.java
// public interface Client
// {
// /**
// * Sets the event listener
// * @param clientListener Nullable event listener
// */
// void setClientListener(final PNetListener clientListener);
//
// /**
// * Connects to given host:port... | import nl.pvdberg.pnet.client.Client; | /*
* MIT License
*
* Copyright (c) 2017 Pim van den Berg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | // Path: src/main/java/nl/pvdberg/pnet/client/Client.java
// public interface Client
// {
// /**
// * Sets the event listener
// * @param clientListener Nullable event listener
// */
// void setClientListener(final PNetListener clientListener);
//
// /**
// * Connects to given host:port... | Client getClient(); |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/client/Client.java | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | import nl.pvdberg.pnet.event.PNetListener;
import nl.pvdberg.pnet.packet.Packet;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket; | /*
* MIT License
*
* Copyright (c) 2017 Pim van den Berg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | void setClientListener(final PNetListener clientListener); |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/client/Client.java | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | import nl.pvdberg.pnet.event.PNetListener;
import nl.pvdberg.pnet.packet.Packet;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket; | /*
* MIT License
*
* Copyright (c) 2017 Pim van den Berg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | boolean send(final Packet packet); |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/server/util/ServerDecorator.java | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | import nl.pvdberg.pnet.event.PNetListener;
import nl.pvdberg.pnet.server.Server;
| package nl.pvdberg.pnet.server.util;
public class ServerDecorator implements Server
{
protected final Server server;
public ServerDecorator(final Server server)
{
this.server = server;
}
@Override
| // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | public void setListener(final PNetListener serverListener)
|
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/event/PNetListener.java | // Path: src/main/java/nl/pvdberg/pnet/client/Client.java
// public interface Client
// {
// /**
// * Sets the event listener
// * @param clientListener Nullable event listener
// */
// void setClientListener(final PNetListener clientListener);
//
// /**
// * Connects to given host:port... | import nl.pvdberg.pnet.client.Client;
import nl.pvdberg.pnet.packet.Packet;
import java.io.IOException; | /*
* MIT License
*
* Copyright (c) 2017 Pim van den Berg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | // Path: src/main/java/nl/pvdberg/pnet/client/Client.java
// public interface Client
// {
// /**
// * Sets the event listener
// * @param clientListener Nullable event listener
// */
// void setClientListener(final PNetListener clientListener);
//
// /**
// * Connects to given host:port... | void onConnect(final Client c); |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/client/ClientImpl.java | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | import java.io.*;
import java.net.InetAddress;
import java.net.Socket;
import java.net.SocketException;
import static nl.pvdberg.pnet.threading.ThreadManager.launchThread;
import nl.pvdberg.pnet.event.PNetListener;
import nl.pvdberg.pnet.factory.SocketFactory;
import nl.pvdberg.pnet.packet.Packet;
import org.slf4j.Logg... | /*
* MIT License
*
* Copyright (c) 2017 Pim van den Berg
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy,... | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | private final SocketFactory sf; |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/client/ClientImpl.java | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | import java.io.*;
import java.net.InetAddress;
import java.net.Socket;
import java.net.SocketException;
import static nl.pvdberg.pnet.threading.ThreadManager.launchThread;
import nl.pvdberg.pnet.event.PNetListener;
import nl.pvdberg.pnet.factory.SocketFactory;
import nl.pvdberg.pnet.packet.Packet;
import org.slf4j.Logg... | {
if (socket != null && !socket.isClosed()) throw new IllegalStateException("Client not closed");
if (host.isEmpty() || port == -1) throw new IllegalStateException("Host and port are not set");
logger.info("Connecting to {}:{}", host, port);
try
{
setSocket(sf.g... | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | launchThread(new Runnable() |
PvdBerg1998/PNet | src/main/java/nl/pvdberg/pnet/client/ClientImpl.java | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | import java.io.*;
import java.net.InetAddress;
import java.net.Socket;
import java.net.SocketException;
import static nl.pvdberg.pnet.threading.ThreadManager.launchThread;
import nl.pvdberg.pnet.event.PNetListener;
import nl.pvdberg.pnet.factory.SocketFactory;
import nl.pvdberg.pnet.packet.Packet;
import org.slf4j.Logg... | }
}
@Override
public synchronized void setSocket(final Socket socket) throws IOException
{
if (this.socket != null && !this.socket.isClosed()) throw new IllegalStateException("Client not closed");
this.socket = socket;
socket.setKeepAlive(false);
dataInputStream... | // Path: src/main/java/nl/pvdberg/pnet/event/PNetListener.java
// public interface PNetListener
// {
// /**
// * Called when a connection is made
// * @param c Connected Client
// */
// void onConnect(final Client c);
//
// /**
// * Called when a connection is lost
// * @param c Lo... | final Packet packet; |
pdsoftplan/zap-maven-plugin | zap-client-api/src/main/java/br/com/softplan/security/zap/api/model/AuthenticationInfo.java | // Path: zap-client-api/src/main/java/br/com/softplan/security/zap/api/authentication/AuthenticationInfoValidator.java
// public final class AuthenticationInfoValidator {
//
// private static final Logger LOGGER = LoggerFactory.getLogger(AuthenticationInfoValidator.class);
//
// public static void validate(Authent... | import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import br.com.softplan.security.zap.api.authentication.AuthenticationInfoValidator; |
/**
* Sets the realm for HTTP authentication.
*
* @param realm the realm for HTTP authentication.
* @return this {@code Builder} instance.
*/
public Builder realm(String realm) {
this.realm = realm;
return this;
}
/**
* Sets the port for HTTP authentication.
*
* @param por... | // Path: zap-client-api/src/main/java/br/com/softplan/security/zap/api/authentication/AuthenticationInfoValidator.java
// public final class AuthenticationInfoValidator {
//
// private static final Logger LOGGER = LoggerFactory.getLogger(AuthenticationInfoValidator.class);
//
// public static void validate(Authent... | AuthenticationInfoValidator.validate(authenticationInfo); |
pdsoftplan/zap-maven-plugin | zap-client-api/src/main/java/br/com/softplan/security/zap/api/report/ZapReportUtil.java | // Path: zap-client-api/src/main/java/br/com/softplan/security/zap/api/exception/ZapClientException.java
// public class ZapClientException extends RuntimeException {
//
// private static final long serialVersionUID = -4867749606526224619L;
//
// public ZapClientException(String message) {
// super(message);
// ... | import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.nio.file.Files;
import java.nio.file.Paths;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import br.com.softplan.security.zap.api.exception.ZapClientException; | * Saves the XML Spider results report to the default path (target/zap-reports/).
*
* @param report the {@link ZapReport} holding the report to be saved.
* @return the saved XML Spider results report as a {@code File} instance.
*/
public static File saveXmlSpiderResults(ZapReport report) {
return saveXmlSp... | // Path: zap-client-api/src/main/java/br/com/softplan/security/zap/api/exception/ZapClientException.java
// public class ZapClientException extends RuntimeException {
//
// private static final long serialVersionUID = -4867749606526224619L;
//
// public ZapClientException(String message) {
// super(message);
// ... | throw new ZapClientException(message, e); |
pdsoftplan/zap-maven-plugin | zap-maven-plugin-core/src/main/java/br/com/softplan/security/zap/maven/StartZapMojo.java | // Path: zap-utils/src/main/java/br/com/softplan/security/zap/commons/boot/Zap.java
// public final class Zap {
//
// private static final Logger LOGGER = LoggerFactory.getLogger(Zap.class);
//
// private static ZapBoot zap;
//
// public static void startZap(ZapInfo zapInfo) {
// zap = ZapBootFactory.makeZapB... | import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.Mojo;
import br.com.softplan.security.zap.commons.boot.Zap; | package br.com.softplan.security.zap.maven;
/**
* Starts ZAP.
* <p>
* Normally this goal will be used along with the {@code seleniumAnalyze} goal.
* <p>
* The usual configuration is to use {@code startZap} in the <i>pre-integration-test</i>,
* to make sure ZAP is running during the tests. If the tests are corr... | // Path: zap-utils/src/main/java/br/com/softplan/security/zap/commons/boot/Zap.java
// public final class Zap {
//
// private static final Logger LOGGER = LoggerFactory.getLogger(Zap.class);
//
// private static ZapBoot zap;
//
// public static void startZap(ZapInfo zapInfo) {
// zap = ZapBootFactory.makeZapB... | Zap.startZap(buildZapInfo()); |
pdsoftplan/zap-maven-plugin | zap-client-api/src/main/java/br/com/softplan/security/zap/api/authentication/AuthenticationScript.java | // Path: zap-utils/src/main/java/br/com/softplan/security/zap/commons/authentication/AuthenticationScripts.java
// public class AuthenticationScripts {
//
// public static final String RELATIVE_PATH = "/scripts/";
// public static final String EXTENSION = ".js";
//
// }
//
// Path: zap-utils/src/main/java/br/com/... | import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import org.apache.commons.io.IOUtils;
import br.com.softplan.security.zap.commons.authentication.AuthenticationScripts;
import br... | package br.com.softplan.security.zap.api.authentication;
public class AuthenticationScript {
private String name;
private String description;
private String fileName;
private String relativePath;
private String path;
private File scriptTempFile;
public AuthenticationScript(String name, String descriptio... | // Path: zap-utils/src/main/java/br/com/softplan/security/zap/commons/authentication/AuthenticationScripts.java
// public class AuthenticationScripts {
//
// public static final String RELATIVE_PATH = "/scripts/";
// public static final String EXTENSION = ".js";
//
// }
//
// Path: zap-utils/src/main/java/br/com/... | this.fileName = name + AuthenticationScripts.EXTENSION; |
pdsoftplan/zap-maven-plugin | zap-client-api/src/main/java/br/com/softplan/security/zap/api/authentication/AuthenticationScript.java | // Path: zap-utils/src/main/java/br/com/softplan/security/zap/commons/authentication/AuthenticationScripts.java
// public class AuthenticationScripts {
//
// public static final String RELATIVE_PATH = "/scripts/";
// public static final String EXTENSION = ".js";
//
// }
//
// Path: zap-utils/src/main/java/br/com/... | import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import org.apache.commons.io.IOUtils;
import br.com.softplan.security.zap.commons.authentication.AuthenticationScripts;
import br... | package br.com.softplan.security.zap.api.authentication;
public class AuthenticationScript {
private String name;
private String description;
private String fileName;
private String relativePath;
private String path;
private File scriptTempFile;
public AuthenticationScript(String name, String descriptio... | // Path: zap-utils/src/main/java/br/com/softplan/security/zap/commons/authentication/AuthenticationScripts.java
// public class AuthenticationScripts {
//
// public static final String RELATIVE_PATH = "/scripts/";
// public static final String EXTENSION = ".js";
//
// }
//
// Path: zap-utils/src/main/java/br/com/... | return ZapDockerBoot.CAS_AUTH_SCRIPT_DEFAULT_DOCKER_PATH + fileName; |
pdsoftplan/zap-maven-plugin | zap-utils/src/main/java/br/com/softplan/security/zap/commons/boot/AbstractZapBoot.java | // Path: zap-utils/src/main/java/br/com/softplan/security/zap/commons/exception/ZapInitializationTimeoutException.java
// public class ZapInitializationTimeoutException extends RuntimeException {
//
// private static final long serialVersionUID = -5283245793671447701L;
//
// public ZapInitializationTimeoutException... | import java.io.File;
import java.io.IOException;
import java.net.ConnectException;
import java.net.HttpURLConnection;
import java.net.URL;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import br.com.softplan.security.zap.commons.exception.ZapInitializationTimeoutException; | static int getResponseFromZap(String host, int port) {
if (host == null) {
return -1;
}
String url = "http://" + host + ":" + port;
int responseCode = -1;
try {
HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection();
conn.setRequestMethod(HEAD);
responseCode = conn.getRe... | // Path: zap-utils/src/main/java/br/com/softplan/security/zap/commons/exception/ZapInitializationTimeoutException.java
// public class ZapInitializationTimeoutException extends RuntimeException {
//
// private static final long serialVersionUID = -5283245793671447701L;
//
// public ZapInitializationTimeoutException... | throw new ZapInitializationTimeoutException(message); |
RentTheRunway/conduit | conduit/src/test/java/io/rtr/conduit/amqp/impl/AMQPQueueConsumerTest.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Envelope;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import io.rtr.conduit.amqp.ActionResponse;
import org.junit.jupiter... | package io.rtr.conduit.amqp.impl;
public class AMQPQueueConsumerTest {
@Test
public void testHandleDeliveryAcknowledge() { | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | final List<AMQPMessageBundle> messages = new ArrayList<>(); |
RentTheRunway/conduit | conduit/src/test/java/io/rtr/conduit/amqp/impl/AMQPQueueConsumerTest.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Envelope;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import io.rtr.conduit.amqp.ActionResponse;
import org.junit.jupiter... | package io.rtr.conduit.amqp.impl;
public class AMQPQueueConsumerTest {
@Test
public void testHandleDeliveryAcknowledge() {
final List<AMQPMessageBundle> messages = new ArrayList<>();
| // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | AMQPConsumerCallback callback = new AMQPConsumerCallback() { |
RentTheRunway/conduit | conduit/src/test/java/io/rtr/conduit/amqp/impl/AMQPQueueConsumerTest.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Envelope;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import io.rtr.conduit.amqp.ActionResponse;
import org.junit.jupiter... | package io.rtr.conduit.amqp.impl;
public class AMQPQueueConsumerTest {
@Test
public void testHandleDeliveryAcknowledge() {
final List<AMQPMessageBundle> messages = new ArrayList<>();
AMQPConsumerCallback callback = new AMQPConsumerCallback() {
@Override | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | public ActionResponse handle(AMQPMessageBundle messageBundle) { |
RentTheRunway/conduit | conduit/src/test/java/io/rtr/conduit/util/LoggingAmqpCallbackHandler.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import io.rtr.conduit.amqp.ActionResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.nio.charset.StandardCharsets; | package io.rtr.conduit.util;
public class LoggingAmqpCallbackHandler implements AMQPConsumerCallback {
private static final Logger LOGGER = LoggerFactory.getLogger(LoggingAmqpCallbackHandler.class);
@Override | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | public ActionResponse handle(AMQPMessageBundle messageBundle) { |
RentTheRunway/conduit | conduit/src/test/java/io/rtr/conduit/util/LoggingAmqpCallbackHandler.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import io.rtr.conduit.amqp.ActionResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.nio.charset.StandardCharsets; | package io.rtr.conduit.util;
public class LoggingAmqpCallbackHandler implements AMQPConsumerCallback {
private static final Logger LOGGER = LoggerFactory.getLogger(LoggingAmqpCallbackHandler.class);
@Override | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | public ActionResponse handle(AMQPMessageBundle messageBundle) { |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/consumer/Consumer.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | import io.rtr.conduit.amqp.transport.Transport;
import io.rtr.conduit.amqp.transport.TransportListenContext;
import java.io.IOException; | package io.rtr.conduit.amqp.consumer;
/**
* The consumer operates in terms of a listen context; an encapsulation of a
* concrete transport and its properties.
*/
public class Consumer implements AutoCloseable {
private TransportListenContext transportContext;
//! Public interface.
Consumer(Transport... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | private Transport getTransport() { |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/consumer/ConsumerBuilder.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | import io.rtr.conduit.amqp.transport.Transport;
import io.rtr.conduit.amqp.transport.TransportConnectionProperties;
import io.rtr.conduit.amqp.transport.TransportListenContext;
import io.rtr.conduit.amqp.transport.TransportListenProperties;
import io.rtr.conduit.amqp.validation.Validatable; | package io.rtr.conduit.amqp.consumer;
public abstract class ConsumerBuilder<T extends Transport
, C extends TransportConnectionProperties | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | , L extends TransportListenProperties |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/consumer/ConsumerBuilder.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | import io.rtr.conduit.amqp.transport.Transport;
import io.rtr.conduit.amqp.transport.TransportConnectionProperties;
import io.rtr.conduit.amqp.transport.TransportListenContext;
import io.rtr.conduit.amqp.transport.TransportListenProperties;
import io.rtr.conduit.amqp.validation.Validatable; | package io.rtr.conduit.amqp.consumer;
public abstract class ConsumerBuilder<T extends Transport
, C extends TransportConnectionProperties
, L extends TransportListenProperties | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | , LC extends TransportListenContext> |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/consumer/ConsumerBuilder.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | import io.rtr.conduit.amqp.transport.Transport;
import io.rtr.conduit.amqp.transport.TransportConnectionProperties;
import io.rtr.conduit.amqp.transport.TransportListenContext;
import io.rtr.conduit.amqp.transport.TransportListenProperties;
import io.rtr.conduit.amqp.validation.Validatable; | package io.rtr.conduit.amqp.consumer;
public abstract class ConsumerBuilder<T extends Transport
, C extends TransportConnectionProperties
, L extends TransportListenProperties
, LC extends TransportListenContex... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/Transport.java
// public abstract class Transport {
// //! Public interface.
//
// //! Establishes a connection to either an intermediary or the other
// // end point. In the case of AMQP, this method is used to connect
// // to the broker.... | extends Validatable { |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/impl/AMQPQueueConsumer.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | import com.rabbitmq.client.AMQP;
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.DefaultConsumer;
import com.rabbitmq.client.Envelope;
import com.rabbitmq.client.ShutdownSignalException;
import io.rtr.conduit.amqp.AMQPConsumerCallback;
import io.rtr.conduit.amqp.AMQPMessageBundle;
import io.rtr.conduit.a... | package io.rtr.conduit.amqp.impl;
public class AMQPQueueConsumer extends DefaultConsumer {
private static final Logger log = LoggerFactory.getLogger(AMQPQueueConsumer.class);
private static final String HEADER_RETRY_COUNT = "conduit-retry-count"; | // Path: conduit/src/main/java/io/rtr/conduit/amqp/AMQPConsumerCallback.java
// public interface AMQPConsumerCallback {
// ActionResponse handle(AMQPMessageBundle messageBundle);
// void notifyOfActionFailure(Exception e);
// void notifyOfShutdown(String consumerTag, ShutdownSignalException sig);
// }
//
/... | private AMQPConsumerCallback callback; |
RentTheRunway/conduit | conduit/src/main/java/io/rtr/conduit/amqp/publisher/Publisher.java | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportMessageBundle.java
// public interface TransportMessageBundle {
// }
//
// Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportPublishContext.java
// public interface TransportPublishContext {
// Transport getTransport();
// T... | import io.rtr.conduit.amqp.transport.TransportMessageBundle;
import io.rtr.conduit.amqp.transport.TransportPublishContext;
import io.rtr.conduit.amqp.transport.TransportPublishProperties;
import java.io.IOException;
import java.util.Collection;
import java.util.concurrent.TimeoutException; | package io.rtr.conduit.amqp.publisher;
/**
* The publisher operates in terms of a publish context; an encapsulation of a
* concrete transport and its properties.
* Example:
*
* AMQPPublishContext context = new AMQPPublishContext(
* username, password, virtualHost, exchange, routingKey, host, port
* );... | // Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportMessageBundle.java
// public interface TransportMessageBundle {
// }
//
// Path: conduit/src/main/java/io/rtr/conduit/amqp/transport/TransportPublishContext.java
// public interface TransportPublishContext {
// Transport getTransport();
// T... | public boolean publish(TransportMessageBundle messageBundle) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.