proj_name stringclasses 131
values | relative_path stringlengths 30 228 | class_name stringlengths 1 68 | func_name stringlengths 1 48 | masked_class stringlengths 78 9.82k | func_body stringlengths 46 9.61k | len_input int64 29 2.01k | len_output int64 14 1.94k | total int64 55 2.05k | relevant_context stringlengths 0 38.4k |
|---|---|---|---|---|---|---|---|---|---|
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryCancel.java | GridQueryCancel | cancel | class GridQueryCancel {
/** */
private final List<QueryCancellable> cancelActions = new ArrayList<>(3);
/** */
private boolean canceled;
/**
* Adds a cancel action.
*
* @param clo Clo.
*/
public synchronized void add(QueryCancellable clo) throws QueryCancelledException {
... |
if (canceled)
return;
canceled = true;
IgniteException ex = null;
// Run actions in the reverse order.
for (int i = cancelActions.size() - 1; i >= 0; i--) {
try {
QueryCancellable act = cancelActions.get(i);
act.doCance... | 252 | 158 | 410 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryRowDescriptorImpl.java | GridQueryRowDescriptorImpl | getAlternativeColumnId | class GridQueryRowDescriptorImpl implements GridQueryRowDescriptor {
/** Non existent column. */
public static final int COL_NOT_EXISTS = -1;
/** */
private final GridCacheContextInfo<?, ?> cacheInfo;
/** */
private final GridQueryTypeDescriptor type;
/** */
private volatile String[]... |
if (keyAliasColId > 0) {
if (colId == QueryUtils.KEY_COL)
return keyAliasColId;
else if (colId == keyAliasColId)
return QueryUtils.KEY_COL;
}
if (valAliasColId > 0) {
if (colId == QueryUtils.VAL_COL)
return valA... | 1,086 | 136 | 1,222 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryEntityEx.java | QueryEntityEx | setAffinityKeyInlineSize | class QueryEntityEx extends QueryEntity {
/** */
private static final long serialVersionUID = 0L;
/** Fields that must have non-null value. */
private Set<String> notNullFields;
/** Whether to preserve order specified by {@link #getKeyFields()} or not. */
private boolean preserveKeysOrder;
... |
if (affKeyInlineSize != null && affKeyInlineSize < 0) {
throw new CacheException("Inline size for affinity fieled index cannot be negative. "
+ "[inlineSize=" + affKeyInlineSize + ']');
}
this.affKeyInlineSize = affKeyInlineSize;
return this;
| 1,670 | 91 | 1,761 | <methods>public void <init>() ,public void <init>(org.apache.ignite.cache.QueryEntity) ,public void <init>(java.lang.String, java.lang.String) ,public void <init>(Class<?>, Class<?>) ,public org.apache.ignite.cache.QueryEntity addQueryField(java.lang.String, java.lang.String, java.lang.String) ,public boolean equals(ja... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryIndexDescriptorImpl.java | QueryIndexDescriptorImpl | addField | class QueryIndexDescriptorImpl implements GridQueryIndexDescriptor {
/** Fields sorted by order number. */
private final Collection<T2<String, Integer>> fields = new TreeSet<>(
new Comparator<T2<String, Integer>>() {
@Override public int compare(T2<String, Integer> o1, T2<String, Integer> o2... |
if (!typDesc.hasField(field))
throw new IgniteCheckedException("Field not found: " + field);
fields.add(new T2<>(field, orderNum));
if (descending) {
if (descendings == null)
descendings = new HashSet<>();
descendings.add(field);
}
... | 783 | 98 | 881 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/QueryTypeNameKey.java | QueryTypeNameKey | equals | class QueryTypeNameKey {
/** */
private final String cacheName;
/** */
private final String typeName;
/**
* @param cacheName Cache name.
* @param typeName Type name.
*/
public QueryTypeNameKey(@Nullable String cacheName, String typeName) {
assert !F.isEmpty(typeName) : t... |
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
QueryTypeNameKey other = (QueryTypeNameKey)o;
return (cacheName != null ? cacheName.equals(other.cacheName) : other.cacheName == null) &&
typeName.equals(other.t... | 242 | 99 | 341 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/messages/GridQueryKillResponse.java | GridQueryKillResponse | readFrom | class GridQueryKillResponse implements Message {
/** */
public static final short TYPE_CODE = 173;
/** */
private static final long serialVersionUID = 0L;
/** Error text. */
private String errMsg;
/** Request id.*/
private long reqId;
/**
* Default constructor.
*/
p... |
reader.setBuffer(buf);
if (!reader.beforeMessageRead())
return false;
switch (reader.state()) {
case 0:
errMsg = reader.readString("errMsg");
if (!reader.isLastRead())
return false;
reader.incrementS... | 594 | 149 | 743 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/property/QueryReadOnlyMethodsAccessor.java | QueryReadOnlyMethodsAccessor | getValue | class QueryReadOnlyMethodsAccessor implements QueryPropertyAccessor {
/** */
private final Method getter;
/** */
private final String propName;
/**
* @param getter Getter method.
* @param propName Property name.
*/
public QueryReadOnlyMethodsAccessor(Method getter, String propNa... |
try {
return getter.invoke(obj);
}
catch (Exception e) {
throw new IgniteCheckedException("Failed to invoke getter method " +
"[type=" + getType() + ", property=" + propName + ']', e);
}
| 298 | 73 | 371 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/running/QueryHistoryTracker.java | QueryHistoryTracker | shrink | class QueryHistoryTracker {
/** Query history. */
private final ConcurrentHashMap<QueryHistoryKey, QueryHistory> qryHist;
/** Queue. */
private final ConcurrentLinkedDeque8<QueryHistory> evictionQueue = new ConcurrentLinkedDeque8<>();
/** History size. */
private final int histSz;
/**
... |
while (true) {
QueryHistory entry = evictionQueue.poll();
if (entry == null)
return;
// History has been changed if we can't remove history entry.
// In this case eviction queue already offered by the entry and we don't put it back. Just try to ... | 900 | 113 | 1,013 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/SchemaIndexCacheCompoundFuture.java | SchemaIndexCacheCompoundFuture | error | class SchemaIndexCacheCompoundFuture extends GridCompoundFuture<SchemaIndexCacheStat, SchemaIndexCacheStat> {
/** Container for the first index rebuild error. */
private final AtomicReference<Throwable> errRef = new AtomicReference<>();
/** {@inheritDoc} */
@Override protected boolean ignoreFailure(Thr... |
Throwable err0 = super.error();
Throwable err1 = errRef.get();
if (err0 != null && err1 != null)
err0.addSuppressed(err1);
return err0 != null ? err0 : err1;
| 139 | 73 | 212 | <methods>public void <init>() ,public void <init>(IgniteReducer<org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheStat,org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheStat>) ,public final GridCompoundFuture<org.apache.ignite.internal.processors.query.schema.SchemaIndexCacheStat,org.a... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/SchemaIndexCacheVisitorImpl.java | SchemaIndexCacheVisitorImpl | indexStatStr | class SchemaIndexCacheVisitorImpl implements SchemaIndexCacheVisitor {
/** Is extra index rebuild logging enabled. */
private final boolean collectStat = getBoolean(IGNITE_ENABLE_EXTRA_INDEX_REBUILD_LOGGING, false);
/** Cache context. */
private final GridCacheContext cctx;
/** Cancellation token.... |
SB res = new SB();
res.a("Details for cache rebuilding [name=" + cctx.cache().name() + ", grpName=" + cctx.group().name() + ']');
res.a(U.nl());
res.a(" Scanned rows " + stat.scannedKeys() + ", visited types " + stat.typeNames());
res.a(U.nl());
IndexProcessor idxPro... | 1,144 | 388 | 1,532 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/schema/management/AbstractIndexDescriptorFactory.java | AbstractIndexDescriptorFactory | keyDefinition | class AbstractIndexDescriptorFactory implements IndexDescriptorFactory {
/** */
protected static LinkedHashMap<String, IndexKeyDefinition> indexDescriptorToKeysDefinition(
GridQueryIndexDescriptor idxDesc,
GridQueryTypeDescriptor typeDesc
) {
LinkedHashMap<String, IndexKeyDefinition>... |
Order order = new Order(ascOrder ? SortOrder.ASC : SortOrder.DESC, null);
GridQueryProperty prop = typeDesc.property(field);
// Try to find property by alternative key field name.
if (prop == null && F.eq(field, QueryUtils.KEY_FIELD_NAME) && !F.isEmpty(typeDesc.keyFieldName()))
... | 180 | 220 | 400 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/stat/Hasher.java | Hasher | fastHash | class Hasher {
/** */
private static final int SEED = 123456;
/** */
private static final int CHUNK_SIZE = 16;
/** */
private static final long C1 = 0x87c37b91114253d5L;
/** */
private static final long C2 = 0x4cf5ad432745937fL;
/** */
private long h1;
/** */
private... |
h1 = SEED;
h2 = SEED;
this.len = 0;
ByteBuffer bb = ByteBuffer.wrap(arr, off, len).order(ByteOrder.LITTLE_ENDIAN);
while (bb.remaining() >= CHUNK_SIZE)
process(bb);
if (bb.remaining() > 0)
processRemaining(bb);
return makeHash();
| 1,704 | 109 | 1,813 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/stat/hll/serialization/BigEndianAscendingWordDeserializer.java | BigEndianAscendingWordDeserializer | readWord | class BigEndianAscendingWordDeserializer implements IWordDeserializer {
/** The number of bits per byte. */
private static final int BITS_PER_BYTE = 8;
/** long mask for the maximum value stored in a byte. */
private static final long BYTE_MASK = (1L << BITS_PER_BYTE) - 1L;
// ********************... |
if (position < 0)
throw new ArrayIndexOutOfBoundsException(position);
// First bit of the word
final long firstBitIdx = (position * wordLength);
final int firstByteIdx = (bytePadding + (int)(firstBitIdx / BITS_PER_BYTE));
final int firstByteSkipBits = (int)(firstBit... | 802 | 750 | 1,552 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/stat/hll/serialization/HLLMetadata.java | HLLMetadata | toString | class HLLMetadata implements IHLLMetadata {
/** */
private final int schemaVersion;
/** */
private final HLLType type;
/** */
private final int registerCountLog2;
/** */
private final int registerWidth;
/** */
private final int log2ExplicitCutoff;
/** */
private fina... |
return "<HLLMetadata schemaVersion: " + this.schemaVersion + ", type: " + this.type.toString() +
", registerCountLog2: " + this.registerCountLog2 + ", registerWidth: " + this.registerWidth +
", log2ExplicitCutoff: " + this.log2ExplicitCutoff + ", explicitOff: " + this.explicitOff +
... | 1,271 | 111 | 1,382 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/stat/hll/util/NumberUtil.java | NumberUtil | fromHex | class NumberUtil {
// loge(2) (log-base e of 2)
public static final double LOGE_2 = 0.6931471805599453;
// ************************************************************************
/**
* Computes the <code>log2</code> (log-base-two) of the specified value.
*
* @param value the <code>doub... |
if (offset >= string.length())
throw new IllegalArgumentException("Offset is greater than the length (" + offset + " >= " +
string.length() + ").")/*by contract*/;
if ( (count & 0x01) != 0)
throw new IllegalArgumentException("Count is not divisible by two (" + c... | 1,684 | 236 | 1,920 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/stat/messages/StatisticsDecimalMessage.java | StatisticsDecimalMessage | writeTo | class StatisticsDecimalMessage implements Message {
/** */
private static final long serialVersionUID = 0L;
/** */
public static final short TYPE_CODE = 184;
/** */
private int scale;
/** */
private byte[] b;
/**
*
*/
public StatisticsDecimalMessage() {
// N... |
writer.setBuffer(buf);
if (!writer.isHeaderWritten()) {
if (!writer.writeHeader(directType(), fieldsCount()))
return false;
writer.onHeaderWritten();
}
switch (writer.state()) {
case 0:
if (!writer.writeByteArray("b"... | 582 | 145 | 727 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/stat/messages/StatisticsKeyMessage.java | StatisticsKeyMessage | readFrom | class StatisticsKeyMessage implements Message {
/** */
private static final long serialVersionUID = 0L;
/** */
public static final short TYPE_CODE = 183;
/** Object schema. */
private String schema;
/** Object name. */
private String obj;
/** Optional list of columns to collect s... |
reader.setBuffer(buf);
if (!reader.beforeMessageRead())
return false;
switch (reader.state()) {
case 0:
colNames = reader.readCollection("colNames", MessageCollectionItemType.STRING);
if (!reader.isLastRead())
return... | 867 | 196 | 1,063 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/stat/messages/StatisticsObjectData.java | StatisticsObjectData | readFrom | class StatisticsObjectData implements Message {
/** */
private static final long serialVersionUID = 0L;
/** */
public static final short TYPE_CODE = 185;
/** Statistics key. */
private StatisticsKeyMessage key;
/** Total row count in current object. */
private long rowsCnt;
/** T... |
reader.setBuffer(buf);
if (!reader.beforeMessageRead())
return false;
switch (reader.state()) {
case 0:
data = reader.readMap("data", MessageCollectionItemType.STRING, MessageCollectionItemType.MSG, false);
if (!reader.isLastRead())
... | 1,116 | 372 | 1,488 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/stat/messages/StatisticsRequest.java | StatisticsRequest | readFrom | class StatisticsRequest implements Message {
/** */
private static final long serialVersionUID = 0L;
/** */
public static final short TYPE_CODE = 187;
/** Gathering id. */
private UUID reqId;
/** Key to supply statistics by. */
private StatisticsKeyMessage key;
/** Type of requir... |
reader.setBuffer(buf);
if (!reader.beforeMessageRead())
return false;
switch (reader.state()) {
case 0:
key = reader.readMessage("key");
if (!reader.isLastRead())
return false;
reader.incrementState(... | 1,032 | 327 | 1,359 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/stat/messages/StatisticsResponse.java | StatisticsResponse | readFrom | class StatisticsResponse implements Message {
/** */
private static final long serialVersionUID = 0L;
/** */
public static final short TYPE_CODE = 188;
/** Request id. */
private UUID reqId;
/** Requested statistics. */
private StatisticsObjectData data;
/**
* Constructor.
... |
reader.setBuffer(buf);
if (!reader.beforeMessageRead())
return false;
switch (reader.state()) {
case 0:
data = reader.readMessage("data");
if (!reader.isLastRead())
return false;
reader.incrementStat... | 584 | 146 | 730 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/query/stat/view/ColumnPartitionDataViewSupplier.java | ColumnPartitionDataViewSupplier | columnPartitionStatisticsViewSupplier | class ColumnPartitionDataViewSupplier {
/** Statistics store. */
private final IgniteStatisticsStore store;
/**
* Constructor.
*
* @param store Statistics store.
*/
public ColumnPartitionDataViewSupplier(IgniteStatisticsStore store) {
this.store = store;
}
/**
... |
String type = (String)filter.get(StatisticsColumnPartitionDataViewWalker.TYPE_FILTER);
if (type != null && !StatisticsColumnConfigurationView.TABLE_TYPE.equalsIgnoreCase(type))
return Collections.emptyList();
String schema = (String)filter.get(StatisticsColumnPartitionDataViewWalk... | 176 | 598 | 774 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/resource/GridResourceProxiedIgniteInjector.java | GridResourceProxiedIgniteInjector | ignite | class GridResourceProxiedIgniteInjector extends GridResourceBasicInjector<Ignite> {
/**
* @param rsrc Resource.
*/
public GridResourceProxiedIgniteInjector(Ignite rsrc) {
super(rsrc);
}
/** */
private Ignite ignite(Object target) {<FILL_FUNCTION_BODY>}
/** {@inheritDoc} */
... |
GridKernalContext ctx = ((IgniteEx)getResource()).context();
return ctx.security().sandbox().enabled() && !isSystemType(ctx, target, false)
? igniteProxy(getResource())
: getResource();
| 244 | 64 | 308 | <methods>public org.apache.ignite.Ignite getResource() ,public void inject(org.apache.ignite.internal.processors.resource.GridResourceField, java.lang.Object, Class<?>, org.apache.ignite.internal.managers.deployment.GridDeployment) throws org.apache.ignite.IgniteCheckedException,public void inject(org.apache.ignite.int... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientTaskResultBean.java | GridClientTaskResultBean | toString | class GridClientTaskResultBean implements Externalizable {
/** */
private static final long serialVersionUID = 0L;
/** Synthetic ID containing task ID and result holding node ID. */
private String id;
/** Execution finished flag. */
private boolean finished;
/** Result. */
private Obj... |
return getClass().getSimpleName() + " [res=" + res + ", error=" + error +
", finished=" + finished + ", id=" + id + "]";
| 565 | 48 | 613 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/client/message/GridClientTopologyRequest.java | GridClientTopologyRequest | equals | class GridClientTopologyRequest extends GridClientAbstractMessage {
/** */
private static final long serialVersionUID = 0L;
/** Id of requested node. */
private UUID nodeId;
/** IP address of requested node. */
private String nodeIp;
/** Include metrics flag. */
private boolean includ... |
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
GridClientTopologyRequest other = (GridClientTopologyRequest)o;
return includeAttrs == other.includeAttrs &&
includeMetrics == other.includeMetrics;
| 768 | 83 | 851 | <methods>public non-sealed void <init>() ,public java.util.UUID clientId() ,public void clientId(java.util.UUID) ,public java.util.UUID destinationId() ,public void destinationId(java.util.UUID) ,public void readExternal(java.io.ObjectInput) throws java.io.IOException, java.lang.ClassNotFoundException,public long reque... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cache/GridCacheRestMetrics.java | GridCacheRestMetrics | map | class GridCacheRestMetrics {
/** Number of reads. */
private int reads;
/** Number of writes. */
private int writes;
/** Number of hits. */
private int hits;
/** Number of misses. */
private int misses;
/**
* Constructor.
*
* @param reads Reads.
* @param write... |
Map<String, Long> map = new GridLeanMap<>(4);
map.put("reads", (long)reads);
map.put("writes", (long)writes);
map.put("hits", (long)hits);
map.put("misses", (long)misses);
return map;
| 601 | 89 | 690 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridBaselineCommandHandler.java | GridBaselineCommandHandler | currentState | class GridBaselineCommandHandler extends GridRestCommandHandlerAdapter {
/** Supported commands. */
private static final Collection<GridRestCommand> SUPPORTED_COMMANDS = U.sealList(BASELINE_CURRENT_STATE,
BASELINE_SET, BASELINE_ADD, BASELINE_REMOVE);
/**
* @param ctx Context.
*/
publi... |
IgniteClusterEx cluster = ctx.grid().cluster();
Collection<? extends BaselineNode> srvrs = cluster.forServers().nodes();
return new GridBaselineCommandResponse(cluster.state().active(), cluster.topologyVersion(), currentBaseLine(), srvrs);
| 1,210 | 71 | 1,281 | <methods><variables>protected final non-sealed org.apache.ignite.internal.GridKernalContext ctx,protected final non-sealed org.apache.ignite.IgniteLogger log |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeClusterStateCommandHandler.java | GridChangeClusterStateCommandHandler | handleAsync | class GridChangeClusterStateCommandHandler extends GridRestCommandHandlerAdapter {
/** Commands. */
private static final Collection<GridRestCommand> COMMANDS = U.sealList(CLUSTER_SET_STATE, CLUSTER_STATE);
/**
* @param ctx Context.
*/
public GridChangeClusterStateCommandHandler(GridKernalCont... |
GridRestClusterStateRequest req = (GridRestClusterStateRequest)restReq;
switch (req.command()) {
case CLUSTER_STATE:
assert req.isReqCurrentMode() : req;
return new GridFinishedFuture<>(new GridRestResponse(ctx.grid().cluster().state()));
defau... | 192 | 208 | 400 | <methods><variables>protected final non-sealed org.apache.ignite.internal.GridKernalContext ctx,protected final non-sealed org.apache.ignite.IgniteLogger log |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/cluster/GridChangeStateCommandHandler.java | GridChangeStateCommandHandler | handleAsync | class GridChangeStateCommandHandler extends GridRestCommandHandlerAdapter {
/** Commands. */
private static final Collection<GridRestCommand> commands =
U.sealList(CLUSTER_ACTIVATE, CLUSTER_DEACTIVATE, CLUSTER_CURRENT_STATE, CLUSTER_ACTIVE, CLUSTER_INACTIVE);
/**
* @param ctx Context.
*/
... |
GridRestChangeStateRequest req = (GridRestChangeStateRequest)restRest;
switch (req.command()) {
case CLUSTER_CURRENT_STATE:
Boolean curState = ctx.state().publicApiActiveState(false);
return new GridFinishedFuture<>(new GridRestResponse(curState));
... | 212 | 204 | 416 | <methods><variables>protected final non-sealed org.apache.ignite.internal.GridKernalContext ctx,protected final non-sealed org.apache.ignite.IgniteLogger log |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/memory/MemoryMetricsCommandHandler.java | MemoryMetricsCommandHandler | handleAsync | class MemoryMetricsCommandHandler extends GridRestCommandHandlerAdapter {
/**
* Supported commands.
*/
private static final Collection<GridRestCommand> SUPPORTED_COMMANDS = U.sealList(
DATA_REGION_METRICS);
/**
* @param ctx Context.
*/
public MemoryMetricsCommandHandler(Grid... |
assert req != null;
if (log.isDebugEnabled())
log.debug("Handling " + req.command().key() + " REST request: " + req);
GridRestCommand cmd = req.command();
switch (cmd) {
case DATA_REGION_METRICS:
return new GridFinishedFuture<>(new GridRestResp... | 189 | 142 | 331 | <methods><variables>protected final non-sealed org.apache.ignite.internal.GridKernalContext ctx,protected final non-sealed org.apache.ignite.IgniteLogger log |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/redis/GridRedisRestCommandHandler.java | GridRedisRestCommandHandler | longValue | class GridRedisRestCommandHandler implements GridRedisCommandHandler {
/** Logger. */
protected final IgniteLogger log;
/** REST protocol handler. */
protected final GridRestProtocolHandler hnd;
/** Kernel context. */
protected final GridKernalContext ctx;
/**
* Constructor.
*
... |
assert name != null;
Iterator<String> it = params.iterator();
while (it.hasNext()) {
if (name.equalsIgnoreCase(it.next())) {
if (it.hasNext()) {
String val = it.next();
try {
return Long.valueOf(val);... | 779 | 172 | 951 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/redis/string/GridRedisAppendCommandHandler.java | GridRedisAppendCommandHandler | asRestRequest | class GridRedisAppendCommandHandler extends GridRedisRestCommandHandler {
/** Supported commands. */
private static final Collection<GridRedisCommand> SUPPORTED_COMMANDS = U.sealList(
APPEND
);
/** Position of the value. */
private static final int VAL_POS = 2;
/**
* Handler const... |
assert msg != null;
if (msg.messageSize() < 3)
throw new GridRedisGenericException("Wrong syntax");
GridRestCacheRequest appendReq = new GridRestCacheRequest();
GridRestCacheRequest getReq = new GridRestCacheRequest();
String val = msg.aux(VAL_POS);
appen... | 404 | 355 | 759 | <methods>public abstract org.apache.ignite.internal.processors.rest.request.GridRestRequest asRestRequest(org.apache.ignite.internal.processors.rest.protocols.tcp.redis.GridRedisMessage) throws org.apache.ignite.IgniteCheckedException,public IgniteInternalFuture<org.apache.ignite.internal.processors.rest.protocols.tcp.... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/redis/string/GridRedisSetCommandHandler.java | GridRedisSetCommandHandler | asRestRequest | class GridRedisSetCommandHandler extends GridRedisRestCommandHandler {
/** Supported commands. */
private static final Collection<GridRedisCommand> SUPPORTED_COMMANDS = U.sealList(
SET
);
/** Value position in Redis message. */
private static final int VAL_POS = 2;
/**
* Handler c... |
assert msg != null;
if (msg.messageSize() < 3)
throw new GridRedisGenericException("Wrong number of arguments");
// check if an atomic long with the key exists (related to incr/decr).
IgniteAtomicLong l = ctx.grid().atomicLong(msg.key(), 0, false);
if (l != null) ... | 532 | 381 | 913 | <methods>public abstract org.apache.ignite.internal.processors.rest.request.GridRestRequest asRestRequest(org.apache.ignite.internal.processors.rest.protocols.tcp.redis.GridRedisMessage) throws org.apache.ignite.IgniteCheckedException,public IgniteInternalFuture<org.apache.ignite.internal.processors.rest.protocols.tcp.... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/rest/handlers/task/GridTaskResultRequest.java | GridTaskResultRequest | writeTo | class GridTaskResultRequest implements Message {
/** */
private static final long serialVersionUID = 0L;
/** Task ID. */
private IgniteUuid taskId;
/** Topic. */
@GridDirectTransient
private Object topic;
/** Serialized topic. */
private byte[] topicBytes;
/**
* Public n... |
writer.setBuffer(buf);
if (!writer.isHeaderWritten()) {
if (!writer.writeHeader(directType(), fieldsCount()))
return false;
writer.onHeaderWritten();
}
switch (writer.state()) {
case 0:
if (!writer.writeIgniteUuid("t... | 725 | 153 | 878 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/security/thread/SecurityAwareRunnable.java | SecurityAwareRunnable | of | class SecurityAwareRunnable implements Runnable {
/** */
private final Runnable delegate;
/** */
private final IgniteSecurity security;
/** */
private final SecurityContext secCtx;
/** */
private SecurityAwareRunnable(IgniteSecurity security, Runnable delegate) {
assert securi... |
if (delegate == null || security.isDefaultContext())
return delegate;
return new SecurityAwareRunnable(security, delegate);
| 216 | 40 | 256 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/service/LazyServiceConfiguration.java | LazyServiceConfiguration | equalsIgnoreNodeFilter | class LazyServiceConfiguration extends ServiceConfiguration {
/** */
private static final long serialVersionUID = 0L;
/** Service instance. */
@GridToStringExclude
private transient Service srvc;
/** Service interceptors. */
@GridToStringExclude
private transient ServiceCallInterceptor... |
if (this == o)
return true;
if (o == null || getClass() != o.getClass())
return false;
LazyServiceConfiguration that = (LazyServiceConfiguration)o;
if (maxPerNodeCnt != that.getMaxPerNodeCount())
return false;
if (totalCnt != that.getTotal... | 897 | 276 | 1,173 | <methods>public non-sealed void <init>() ,public boolean equals(java.lang.Object) ,public boolean equalsIgnoreNodeFilter(java.lang.Object) ,public java.lang.Object getAffinityKey() ,public java.lang.String getCacheName() ,public org.apache.ignite.services.ServiceCallInterceptor[] getInterceptors() ,public int getMaxPer... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/service/ServiceContextImpl.java | ServiceContextImpl | method | class ServiceContextImpl implements ServiceContext {
/** */
private static final long serialVersionUID = 0L;
/** Null method. */
private static final Method NULL_METHOD = ServiceContextImpl.class.getMethods()[0];
/** Service name. */
private final String name;
/** Execution ID. */
pri... |
Method mtd = mtds.get(key);
if (mtd == null) {
try {
mtd = svc.getClass().getMethod(key.methodName(), key.argTypes());
mtd.setAccessible(true);
}
catch (NoSuchMethodException ignored) {
mtd = NULL_METHOD;
... | 1,163 | 127 | 1,290 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/timeout/GridTimeoutProcessor.java | TimeoutWorker | body | class TimeoutWorker extends GridWorker {
/**
*
*/
TimeoutWorker() {
super(
ctx.config().getIgniteInstanceName(),
"grid-timeout-worker",
GridTimeoutProcessor.this.log,
ctx.workersRegistry()
);
... |
Throwable err = null;
try {
while (!isCancelled()) {
updateHeartbeat();
long now = U.currentTimeMillis();
onIdle();
for (Iterator<GridTimeoutObject> iter = timeoutObjs.iterator(); iter.hasNext();... | 114 | 682 | 796 | <methods>public void collectGridNodeData(org.apache.ignite.spi.discovery.DiscoveryDataBag) ,public void collectJoiningNodeData(org.apache.ignite.spi.discovery.DiscoveryDataBag) ,public org.apache.ignite.internal.GridComponent.DiscoveryDataExchangeType discoveryDataType() ,public void onDisconnected(IgniteFuture<?>) thr... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/configuration/DistributedTracingConfiguration.java | DistributedTracingConfiguration | parse | class DistributedTracingConfiguration
extends SimpleDistributedProperty<HashMap<TracingConfigurationCoordinates, TracingConfigurationParameters>> {
/** */
private static final String TRACING_CONFIGURATION_DISTRIBUTED_METASTORE_KEY = "tr.config";
/**
* Constructor.
*/
public DistributedTra... |
throw new IgniteException("Please use the '--tracing-configuration' command to modify the tracing configuration");
| 258 | 29 | 287 | <methods>public void <init>(java.lang.String, Function<java.lang.String,HashMap<org.apache.ignite.spi.tracing.TracingConfigurationCoordinates,org.apache.ignite.spi.tracing.TracingConfigurationParameters>>, java.lang.String) ,public void addListener(DistributePropertyListener<? super HashMap<org.apache.ignite.spi.tracin... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/processors/tracing/messages/TraceableMessagesHandler.java | TraceableMessagesHandler | beforeSend | class TraceableMessagesHandler {
/** Span manager. */
private final SpanManager spanMgr;
/** Logger. */
private final IgniteLogger log;
/**
* @param spanMgr Span manager.
* @param log Logger.
*/
public TraceableMessagesHandler(SpanManager spanMgr, IgniteLogger log) {
thi... |
if (msg.spanContainer().span() != NoopSpan.INSTANCE && msg.spanContainer().serializedSpanBytes() == null)
msg.spanContainer().serializedSpanBytes(spanMgr.serialize(msg.spanContainer().span()));
| 717 | 62 | 779 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/sql/command/SqlDropIndexCommand.java | SqlDropIndexCommand | parse | class SqlDropIndexCommand implements SqlCommand {
/** Schema name. */
private String schemaName;
/** Index name. */
private String idxName;
/** IF EXISTS flag. */
private boolean ifExists;
/**
* Default constructor.
*/
public SqlDropIndexCommand() {
}
/**
* @pa... |
ifExists = parseIfExists(lex);
SqlQualifiedName idxQName = parseQualifiedIdentifier(lex, IF);
schemaName = idxQName.schemaName();
idxName = idxQName.name();
return this;
| 383 | 66 | 449 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/sql/command/SqlStatisticsCommands.java | SqlStatisticsCommands | parseColumn | class SqlStatisticsCommands implements SqlCommand {
/** Schema name. */
private String schemaName;
/** Targets to process. */
protected List<StatisticsTarget> targets = new ArrayList<>();
/** */
protected SqlStatisticsCommands() {
// No-op.
}
/** */
protected SqlStatistics... |
String name = parseIdentifier(lex);
if (!cols.add(name))
throw error(lex, "Column " + name + " already defined.");
| 796 | 41 | 837 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/sql/optimizer/affinity/PartitionClientContext.java | PartitionClientContext | partition | class PartitionClientContext {
/** Number of partitions. */
private int parts;
/** Mask to use in calculation when partitions count is power of 2. */
private int mask;
/**
* Constructor.
*
* @param parts Partitions count.
*/
public PartitionClientContext(int parts) {
... |
if (typ == null)
return null;
Object key = PartitionDataTypeUtils.convert(arg, typ);
if (key == PartitionDataTypeUtils.CONVERTATION_FAILURE)
return null;
if (key == null)
return null;
return RendezvousAffinityFunction.calculatePartition(ke... | 227 | 99 | 326 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/sql/optimizer/affinity/PartitionJoinCondition.java | PartitionJoinCondition | equals | class PartitionJoinCondition {
/** Cross JOIN. */
public static final PartitionJoinCondition CROSS = new PartitionJoinCondition(null, null, null, null, true);
/** Left alias. */
private final String leftAlias;
/** Right alias. */
private final String rightAlias;
/** Left column name. */
... |
if (obj instanceof PartitionJoinCondition) {
PartitionJoinCondition other = (PartitionJoinCondition)obj;
return F.eq(leftAlias, other.leftAlias) && F.eq(rightAlias, other.rightAlias) &&
F.eq(leftCol, other.leftCol) && F.eq(rightCol, other.rightCol) && F.eq(cross, other.... | 704 | 111 | 815 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/sql/optimizer/affinity/PartitionParameterNode.java | PartitionParameterNode | applySingle | class PartitionParameterNode extends PartitionSingleNode {
/** Indexing. */
@GridToStringExclude
private final PartitionResolver partRslvr;
/** Index. */
private final int idx;
/** Parameter data type. */
private final int type;
/** Client parameter type. */
private final Partitio... |
assert args != null;
assert idx < args.length;
Object arg = args[idx];
if (cliCtx != null)
return cliCtx.partition(arg, clientType);
else {
assert partRslvr != null;
return partRslvr.partition(
arg,
type,
... | 463 | 105 | 568 | <methods>public transient Collection<java.lang.Integer> apply(org.apache.ignite.internal.sql.optimizer.affinity.PartitionClientContext, java.lang.Object[]) throws org.apache.ignite.IgniteCheckedException,public transient abstract java.lang.Integer applySingle(org.apache.ignite.internal.sql.optimizer.affinity.PartitionC... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/sql/optimizer/affinity/PartitionResult.java | PartitionResult | calculatePartitions | class PartitionResult {
/** Tree. */
@GridToStringInclude
private final PartitionNode tree;
/** Affinity function. */
private final PartitionTableAffinityDescriptor aff;
/** Affinity topology version. Used within Jdbc thin partition awareness. */
private final AffinityTopologyVersion topVe... |
if (!F.isEmpty(explicitParts))
return explicitParts;
else if (derivedParts != null) {
try {
Collection<Integer> realParts = derivedParts.tree().apply(null, args);
if (realParts == null)
return null;
else if (re... | 951 | 218 | 1,169 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/sql/optimizer/affinity/PartitionTableAffinityDescriptor.java | PartitionTableAffinityDescriptor | isCompatible | class PartitionTableAffinityDescriptor {
/** Affinity function type. */
private final PartitionAffinityFunctionType affFunc;
/** Number of partitions. */
private final int parts;
/** Whether node filter is set. */
private final boolean hasNodeFilter;
/** Data region name. */
private f... |
if (other == null)
return false;
// Rendezvous affinity function is deterministic and doesn't depend on previous cluster view changes.
// In future other user affinity functions would be applicable as well if explicityl marked deterministic.
if (affFunc == PartitionAffinity... | 484 | 229 | 713 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/GridArgumentCheck.java | GridArgumentCheck | notEmpty | class GridArgumentCheck {
/** Null pointer error message prefix. */
public static final String NULL_MSG_PREFIX = "Ouch! Argument cannot be null: ";
/** Invalid argument error message prefix. */
private static final String INVALID_ARG_MSG_PREFIX = "Ouch! Argument is invalid: ";
/** Not empty argume... |
notNull(arr, name);
if (arr.length == 0)
throw new IllegalArgumentException(INVALID_ARG_MSG_PREFIX + name + NOT_EMPTY_SUFFIX);
| 1,881 | 53 | 1,934 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/GridAtomicInitializer.java | GridAtomicInitializer | init | class GridAtomicInitializer<T> {
/** */
private final Object mux = new Object();
/** */
private volatile boolean finished;
/** Don't use volatile because we write this field before 'finished' write and read after 'finished' read. */
@SuppressWarnings("FieldAccessedSynchronizedAndUnsynchronized... |
if (!finished) {
synchronized (mux) {
if (!finished) {
try {
res = c.call();
}
catch (Exception e) {
this.e = e;
}
finally {
... | 468 | 136 | 604 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/GridAtomicInteger.java | GridAtomicInteger | setIfNotEquals | class GridAtomicInteger extends AtomicInteger {
/** */
private static final long serialVersionUID = 0L;
/**
* Creates a new AtomicInteger with initial value {@code 0}.
*/
public GridAtomicInteger() {
// No-op.
}
/**
* Creates a new AtomicInteger with the given initial va... |
while (true) {
int cur = get();
if (update != cur) {
if (compareAndSet(cur, update))
return true;
}
else
return false;
}
| 1,408 | 59 | 1,467 | <methods>public void <init>() ,public void <init>(int) ,public final int accumulateAndGet(int, java.util.function.IntBinaryOperator) ,public final int addAndGet(int) ,public final int compareAndExchange(int, int) ,public final int compareAndExchangeAcquire(int, int) ,public final int compareAndExchangeRelease(int, int)... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/GridCircularBuffer.java | Item | update | class Item<V> {
/** */
private long idx;
/** */
@GridToStringInclude
private V item;
/**
*
*/
Item() {
// No-op.
}
/**
* @return Item.
*/
synchronized V item() {
return item;
... |
assert newIdx >= 0;
// Thread should wait and allow previous update to finish.
while (newIdx - idx > maxIdxDiff)
wait();
idx = newIdx; // Index should be updated even if closure fails.
if (c != null && item != null)
c.applyx... | 535 | 116 | 651 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/GridCloseableIteratorAdapterEx.java | GridCloseableIteratorAdapterEx | hasNextX | class GridCloseableIteratorAdapterEx<T> extends GridIteratorAdapter<T>
implements GridCloseableIterator<T> {
/** */
private static final long serialVersionUID = 0L;
/** Closed flag. */
private final AtomicBoolean closed = new AtomicBoolean();
/** {@inheritDoc} */
@Override public final T n... |
if (closed.get())
return false;
try {
return onHasNext();
}
catch (IgniteCheckedException e) {
if (closed.get())
return false;
else
throw e;
}
| 621 | 67 | 688 | <methods>public non-sealed void <init>() ,public final boolean hasNext() ,public final Iterator<T> iterator() ,public final T next() ,public final void remove() <variables>private static final long serialVersionUID |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/GridCollections.java | LockedCollection | remove | class LockedCollection<E> extends ReentrantLock implements Collection<E> {
/** */
private static final long serialVersionUID = 0L;
/** Delegating collection. */
protected final Collection<E> c;
/**
* @param c Delegating collection.
*/
private LockedCol... |
lock();
try {
return c.remove(o);
}
finally {
unlock();
}
| 1,079 | 35 | 1,114 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/GridConcurrentMultiPairQueue.java | GridConcurrentMultiPairQueue | next | class GridConcurrentMultiPairQueue<K, V> {
/** */
public static final GridConcurrentMultiPairQueue EMPTY =
new GridConcurrentMultiPairQueue<>(Collections.emptyMap());
/** Inner holder. */
private final V[][] vals;
/** Storage for every array length. */
private final int[] lenSeq;
... |
int absPos = pos.getAndIncrement();
if (absPos >= maxPos) {
res.set(null, null, 0);
return false;
}
int segment = res.getSegment();
if (absPos > lenSeq[segment]) {
segment = Arrays.binarySearch(lenSeq, segment, lenSeq.length - 1, absPos);
... | 1,019 | 198 | 1,217 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/GridStripedSpinBusyLock.java | GridStripedSpinBusyLock | block | class GridStripedSpinBusyLock {
/** Writer mask. */
private static int WRITER_MASK = 1 << 30;
/** Default amount of stripes. */
private static final int DFLT_STRIPE_CNT = Runtime.getRuntime().availableProcessors() * 4;
/** Thread index. */
private static ThreadLocal<Integer> THREAD_IDX = new T... |
// 1. CAS-loop to set a writer bit.
for (AtomicInteger state : states) {
while (true) {
int oldVal = state.get();
if (state.compareAndSet(oldVal, oldVal | WRITER_MASK))
break;
}
}
// 2. Wait until all readers ... | 549 | 193 | 742 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteCollectors.java | IgniteCollectors | toCompoundFuture | class IgniteCollectors {
/**
* Empty constructor.
*/
private IgniteCollectors() { }
/**
* Collector of {@link IgniteInternalFuture} inheritors stream to {@link GridCompoundFuture}.
*
* @param <T> Result type of inheritor {@link IgniteInternalFuture}.
* @param <R> Result type o... |
final GridCompoundFuture<T, R> res = new GridCompoundFuture<>();
return Collectors.collectingAndThen(
Collectors.reducing(
res,
res::add,
(a, b) -> a // No needs to merge compound futures.
),
GridCompoundFuture::markIn... | 199 | 89 | 288 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/IgniteExceptionRegistry.java | IgniteExceptionRegistry | onException | class IgniteExceptionRegistry {
/** */
public static final int DEFAULT_QUEUE_SIZE = 1000;
/** */
private static final IgniteExceptionRegistry instance = new IgniteExceptionRegistry();
/** */
private int maxSize = IgniteSystemProperties.getInteger(IGNITE_EXCEPTION_REGISTRY_MAX_SIZE, DEFAULT_QUE... |
q.offerFirst(
new ExceptionInfo(
errCnt.incrementAndGet(),
e,
msg,
Thread.currentThread().getId(),
Thread.currentThread().getName(),
U.currentTimeMillis()));
// Remove extra entries.
int... | 1,318 | 117 | 1,435 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/ReentrantReadWriteLockWithTracking.java | ReadLockWithTracking | dec | class ReadLockWithTracking extends ReentrantReadWriteLock.ReadLock {
/** */
private static final long serialVersionUID = 0L;
/** */
private static final ThreadLocal<T2<Integer, Long>> READ_LOCK_HOLDER_TS =
ThreadLocal.withInitial(() -> new T2<>(0, 0L));
/** */
... |
T2<Integer, Long> val = READ_LOCK_HOLDER_TS.get();
int cntr = val.get1();
if (--cntr == 0) {
long timeout = U.currentTimeMillis() - val.get2();
if (timeout > readLockThreshold) {
GridStringBuilder sb = new GridStringBuilder();
... | 542 | 186 | 728 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/UUIDCollectionMessage.java | UUIDCollectionMessage | readFrom | class UUIDCollectionMessage implements Message {
/** */
private static final long serialVersionUID = 0L;
/** */
@GridDirectCollection(UUID.class)
private Collection<UUID> uuids;
/**
* Empty constructor required for direct marshalling.
*/
public UUIDCollectionMessage() {
/... |
reader.setBuffer(buf);
if (!reader.beforeMessageRead())
return false;
switch (reader.state()) {
case 0:
uuids = reader.readCollection("uuids", MessageCollectionItemType.UUID);
if (!reader.isLastRead())
return false;
... | 784 | 110 | 894 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/collection/IntRWHashMap.java | IntRWHashMap | putIfAbsent | class IntRWHashMap<V> implements IntMap<V> {
/** RW Lock. */
private final ReadWriteLock lock = new ReentrantReadWriteLock();
/** Map delegate. */
private final IntHashMap<V> delegate;
/** Default constructor. */
public IntRWHashMap() {
delegate = new IntHashMap<>();
}
/** {@i... |
lock.writeLock().lock();
try {
return delegate.putIfAbsent(key, val);
}
finally {
lock.writeLock().unlock();
}
| 882 | 49 | 931 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/future/CountDownFuture.java | CountDownFuture | addError | class CountDownFuture extends GridFutureAdapter<Void> {
/** */
private AtomicInteger remaining;
/** */
private AtomicReference<Exception> errCollector;
/**
* @param cnt Number of completing parties.
*/
public CountDownFuture(int cnt) {
remaining = new AtomicInteger(cnt);
... |
Exception ex = errCollector.get();
if (ex == null) {
Exception compound = new IgniteCheckedException("Compound exception for CountDownFuture.");
ex = errCollector.compareAndSet(null, compound) ? compound : errCollector.get();
}
assert ex != null;
ex.a... | 285 | 93 | 378 | <methods>public non-sealed void <init>() ,public boolean cancel() throws org.apache.ignite.IgniteCheckedException,public IgniteInternalFuture<T> chain(IgniteClosure<? super IgniteInternalFuture<java.lang.Void>,T>) ,public IgniteInternalFuture<T> chain(IgniteOutClosure<T>) ,public IgniteInternalFuture<T> chain(IgniteClo... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/future/GridEmbeddedFuture.java | AsyncListener2 | apply | class AsyncListener2 implements IgniteInClosure<IgniteInternalFuture<A>> {
/** */
private static final long serialVersionUID = 0L;
/** {@inheritDoc} */
@Override public final void apply(IgniteInternalFuture<A> f) {<FILL_FUNCTION_BODY>}
/**
* @param f Future.
*... |
try {
applyx(f);
}
catch (IgniteIllegalStateException ignore) {
U.warn(null, "Will not execute future listener (grid is stopping): " + this);
}
catch (Exception e) {
onDone(e);
}
catch (E... | 128 | 98 | 226 | <methods>public non-sealed void <init>() ,public boolean cancel() throws org.apache.ignite.IgniteCheckedException,public IgniteInternalFuture<T> chain(IgniteClosure<? super IgniteInternalFuture<A>,T>) ,public IgniteInternalFuture<T> chain(IgniteOutClosure<T>) ,public IgniteInternalFuture<T> chain(IgniteClosure<? super ... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteFutureImpl.java | IgniteFutureImpl | get | class IgniteFutureImpl<V> implements IgniteFuture<V> {
/** */
protected final IgniteInternalFuture<V> fut;
/** */
protected final Executor defaultExecutor;
/**
* @param fut Future.
*/
public IgniteFutureImpl(IgniteInternalFuture<V> fut) {
this(fut, null);
}
/**
... |
try {
return fut.get(timeout);
}
catch (IgniteCheckedException e) {
throw convertException(e);
}
| 1,618 | 42 | 1,660 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/future/IgniteRemoteMapTask.java | IgniteRemoteMapTask | map | class IgniteRemoteMapTask<T, R> extends ComputeTaskAdapter<T, R> {
/** */
private static final long serialVersionUID = 0L;
/** */
private final ClusterNode node;
/** */
private final ComputeTask<T, R> remoteTask;
/**
* @param node Target node.
* @param remoteTask Delegate task.
... |
for (ClusterNode node : subgrid) {
if (node.equals(this.node))
return Collections.singletonMap(new Job<>(remoteTask, arg), node);
}
throw new IgniteException("Node " + node + " is not present in subgrid.");
| 673 | 74 | 747 | <methods>public non-sealed void <init>() ,public org.apache.ignite.compute.ComputeJobResultPolicy result(org.apache.ignite.compute.ComputeJobResult, List<org.apache.ignite.compute.ComputeJobResult>) throws org.apache.ignite.IgniteException<variables>private static final long serialVersionUID |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/io/GridFileUtils.java | GridFileUtils | copy | class GridFileUtils {
/** Copy buffer size. */
private static final int COPY_BUFFER_SIZE = 1024 * 1024;
/**
* Copy file
*
* @param src Source.
* @param dst Dst.
* @param maxBytes Max bytes.
*/
public static void copy(FileIO src, FileIO dst, long maxBytes) throws IOExceptio... |
boolean err = true;
try (FileIO dstIO = dstFactory.create(dst, CREATE, TRUNCATE_EXISTING, WRITE)) {
try (FileIO srcIO = srcFactory.create(src, READ)) {
copy(srcIO, dstIO, maxBytes);
err = false;
}
}
finally {
if (err)... | 610 | 112 | 722 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/io/GridReversedLinesFileReader.java | FilePart | readLine | class FilePart {
/** */
private final long no;
/** */
private final byte[] data;
/** */
private byte[] leftOver;
/** */
private int currentLastBytePos;
/**
* ctor
* @param no the part number
* @param length its length... |
String line = null;
int newLineMatchByteCnt;
boolean isLastFilePart = no == 1;
int i = currentLastBytePos;
while (i > -1) {
if (!isLastFilePart && i < avoidNewlineSplitBufferSize) {
// avoidNewlineSplitBuffer: for all e... | 1,009 | 449 | 1,458 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/lang/GridAbsClosureX.java | GridAbsClosureX | apply | class GridAbsClosureX extends GridAbsClosure {
/** */
private static final long serialVersionUID = 0L;
/** {@inheritDoc} */
@Override public void apply() {<FILL_FUNCTION_BODY>}
/**
* Closure body that can throw {@link IgniteCheckedException}.
*
* @throws IgniteCheckedException Throw... |
try {
applyx();
}
catch (IgniteCheckedException ex) {
throw F.wrap(ex);
}
| 130 | 39 | 169 | <methods>public non-sealed void <init>() ,public abstract void apply() ,public final void run() <variables>private static final long serialVersionUID |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/lang/IgniteClosure2X.java | IgniteClosure2X | apply | class IgniteClosure2X<E1, E2, R> implements IgniteBiClosure<E1, E2, R> {
/** */
private static final long serialVersionUID = 0L;
/** {@inheritDoc} */
@Override public R apply(E1 e1, E2 e2) {<FILL_FUNCTION_BODY>}
/**
* Closure body that can throw {@link IgniteCheckedException}.
*
* @... |
try {
return applyx(e1, e2);
}
catch (IgniteCheckedException e) {
throw F.wrap(e);
}
| 231 | 46 | 277 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/lang/IgniteInClosureX.java | IgniteInClosureX | apply | class IgniteInClosureX<T> implements IgniteInClosure<T> {
/** */
private static final long serialVersionUID = 0L;
/** {@inheritDoc} */
@Override public void apply(T t) {<FILL_FUNCTION_BODY>}
/**
* In-closure body that can throw {@link IgniteCheckedException}.
*
* @param t The variab... |
try {
applyx(t);
}
catch (IgniteCheckedException e) {
throw F.wrap(e);
}
| 160 | 41 | 201 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/lang/IgniteSingletonIterator.java | IgniteSingletonIterator | onNext | class IgniteSingletonIterator<T> extends GridCloseableIteratorAdapter<T> {
/** */
private static final long serialVersionUID = 0L;
/** */
private final T val;
/** */
private boolean hasNext = true;
/** */
public IgniteSingletonIterator(T val) {
this.val = val;
}
/** {... |
if (!hasNext)
throw new NoSuchElementException();
hasNext = false;
return val;
| 166 | 33 | 199 | <methods>public non-sealed void <init>() ,public final void close() throws org.apache.ignite.IgniteCheckedException,public final boolean hasNextX() throws org.apache.ignite.IgniteCheckedException,public boolean isClosed() ,public final T nextX() throws org.apache.ignite.IgniteCheckedException,public final void removeX(... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/FlatIterator.java | FlatIterator | hasNextX | class FlatIterator<T> extends GridIteratorAdapter<T> {
/** */
private static final long serialVersionUID = 0L;
/** */
private Iterator<?> iter;
/** */
private Iterator<T> next;
/** */
private boolean moved;
/** */
private boolean more;
/**
* @param iterable Input it... |
if (!moved)
return more;
moved = false;
if (next != null && next.hasNext())
return more = true;
while (iter.hasNext()) {
Object obj = iter.next();
if (obj instanceof Iterable)
next = ((Iterable)obj).iterator();
... | 315 | 150 | 465 | <methods>public non-sealed void <init>() ,public final boolean hasNext() ,public final Iterator<T> iterator() ,public final T next() ,public final void remove() <variables>private static final long serialVersionUID |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/PredicateMapView.java | PredicateMapView | entrySet | class PredicateMapView<K, V> extends GridSerializableMap<K, V> {
/** */
private static final long serialVersionUID = 5531745605372387948L;
/** */
private final Map<K, V> map;
/** */
private final IgnitePredicate<? super K>[] preds;
/** Entry predicate. */
private IgnitePredicate<Entry... |
return new GridSerializableSet<Entry<K, V>>() {
@NotNull
@Override public Iterator<Entry<K, V>> iterator() {
return GridFunc.iterator0(map.entrySet(), false, entryPred);
}
@Override public int size() {
return F.size(map.keySet(), ... | 501 | 210 | 711 | <methods>public non-sealed void <init>() <variables>private static final long serialVersionUID |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/lang/gridfunc/TransformMapView2.java | TransformMapView2 | entrySet | class TransformMapView2<K, V, V1> extends GridSerializableMap<K, V1> {
/** */
private static final long serialVersionUID = 0L;
/** */
private final Map<K, V> map;
/** */
private final IgniteBiClosure<K, V, V1> clos;
/** */
private final IgnitePredicate<? super K>[] preds;
/** Ent... |
return new GridSerializableSet<Entry<K, V1>>() {
@NotNull
@Override public Iterator<Entry<K, V1>> iterator() {
return new Iterator<Entry<K, V1>>() {
private Iterator<Entry<K, V>> it = GridFunc.iterator0(map.entrySet(), true, entryPred);
... | 646 | 426 | 1,072 | <methods>public non-sealed void <init>() <variables>private static final long serialVersionUID |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridConnectionBytesVerifyFilter.java | GridConnectionBytesVerifyFilter | onMessageReceived | class GridConnectionBytesVerifyFilter extends GridNioFilterAdapter {
/** */
private static final int MAGIC_META_KEY = GridNioSessionMetaKey.nextUniqueKey();
/** */
private static final int MAGIC_BUF_KEY = GridNioSessionMetaKey.nextUniqueKey();
/** */
private IgniteLogger log;
/**
* C... |
// Verify only incoming connections.
if (!ses.accepted()) {
proceedMessageReceived(ses, msg);
return;
}
if (!(msg instanceof ByteBuffer))
throw new GridNioException("Failed to decode incoming message (message should be a byte buffer, is " +
... | 586 | 536 | 1,122 | <methods>public org.apache.ignite.internal.util.nio.GridNioFilter nextFilter() ,public void nextFilter(org.apache.ignite.internal.util.nio.GridNioFilter) ,public GridNioFuture<?> onPauseReads(org.apache.ignite.internal.util.nio.GridNioSession) throws org.apache.ignite.IgniteCheckedException,public GridNioFuture<?> onRe... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDelimitedParser.java | GridDelimitedParser | decode | class GridDelimitedParser implements GridNioParser {
/** Buffer metadata key. */
private static final int BUF_META_KEY = GridNioSessionMetaKey.nextUniqueKey();
/** Delimiter. */
private final byte[] delim;
/** Direct buffer. */
private final boolean directBuf;
/**
* @param delim Deli... |
GridNioDelimitedBuffer nioBuf = ses.meta(BUF_META_KEY);
// Decode for a given session is called per one thread, so there should not be any concurrency issues.
// However, we make some additional checks.
if (nioBuf == null) {
nioBuf = new GridNioDelimitedBuffer(delim);
... | 366 | 146 | 512 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/nio/GridDirectParser.java | GridDirectParser | decode | class GridDirectParser implements GridNioParser {
/** Message metadata key. */
static final int MSG_META_KEY = GridNioSessionMetaKey.nextUniqueKey();
/** Reader metadata key. */
static final int READER_META_KEY = GridNioSessionMetaKey.nextUniqueKey();
/** */
private final IgniteLogger log;
... |
MessageReader reader = ses.meta(READER_META_KEY);
if (reader == null)
ses.addMeta(READER_META_KEY, reader = readerFactory.reader(ses, msgFactory));
Message msg = ses.removeMeta(MSG_META_KEY);
try {
if (msg == null && buf.remaining() >= Message.DIRECT_TYPE_SIZE... | 351 | 350 | 701 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/nio/SelectedSelectionKeySet.java | SelectedSelectionKeySet | doubleCapacityB | class SelectedSelectionKeySet extends AbstractSet<SelectionKey> {
/** */
private SelectionKey[] keysA;
/** */
private int keysASize;
/** */
private SelectionKey[] keysB;
/** */
private int keysBSize;
/** */
private boolean isA = true;
/**
*
*/
SelectedSelec... |
SelectionKey[] newKeysB = new SelectionKey[keysB.length << 1];
System.arraycopy(keysB, 0, newKeysB, 0, keysBSize);
keysB = newKeysB;
| 649 | 58 | 707 | <methods>public boolean equals(java.lang.Object) ,public int hashCode() ,public boolean removeAll(Collection<?>) <variables> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/nodestart/IgniteRemoteStartSpecification.java | IgniteRemoteStartSpecification | hashCode | class IgniteRemoteStartSpecification {
/** Hostname. */
private final String host;
/** Port number. */
private final int port;
/** Username. */
private final String uname;
/** Password. */
private final String passwd;
/** Private key file. */
private final File key;
/** ... |
int res = host == null ? 0 : host.hashCode();
res = 31 * res + (uname == null ? 0 : uname.hashCode());
res = 31 * res + (passwd == null ? 0 : passwd.hashCode());
res = 31 * res + (key == null ? 0 : key.hashCode());
res = 31 * res + (igniteHome == null ? 0 : igniteHome.hashCode(... | 1,820 | 190 | 2,010 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/util/worker/CycleThread.java | CycleThread | run | class CycleThread extends Thread {
/** Sleep interval before each iteration. */
private final long sleepInterval;
/**
* Creates new cycle thread with given parameters.
*
* @param name thread name
* @param sleepInterval sleep interval before each iteration
*/
protected CycleThr... |
try {
while (!isInterrupted()) {
Thread.sleep(sleepInterval);
iteration();
}
}
catch (InterruptedException e) {
// No-op
}
| 199 | 55 | 254 | <methods>public void <init>() ,public void <init>(java.lang.Runnable) ,public void <init>(java.lang.String) ,public void <init>(java.lang.ThreadGroup, java.lang.Runnable) ,public void <init>(java.lang.ThreadGroup, java.lang.String) ,public void <init>(java.lang.Runnable, java.lang.String) ,public void <init>(java.lang.... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorDataTransferObject.java | VisorDataTransferObject | readExternal | class VisorDataTransferObject implements Externalizable {
/** */
private static final long serialVersionUID = 6920203681702514010L;
/** Magic number to detect correct transfer objects. */
private static final int MAGIC = 0x42BEEF00;
/** Version 1. */
protected static final byte V1 = 1;
/*... |
int hdr = in.readInt();
if ((hdr & MAGIC) != MAGIC)
throw new IOException("Unexpected VisorDataTransferObject header " +
"[actual=" + Integer.toHexString(hdr) + ", expected=" + Integer.toHexString(MAGIC) + "]");
byte ver = (byte)(hdr & 0xFF);
try (VisorDat... | 713 | 146 | 859 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/internal/visor/VisorTaskArgument.java | VisorTaskArgument | readExternalData | class VisorTaskArgument<A> extends VisorDataTransferObject {
/** */
private static final long serialVersionUID = 0L;
/** Node IDs task should be mapped to. */
private List<UUID> nodes;
/** Task argument. */
private A arg;
/** Debug flag. */
private boolean debug;
/**
* Defau... |
nodes = U.readList(in);
arg = (A)in.readObject();
debug = in.readBoolean();
| 729 | 35 | 764 | <methods>public non-sealed void <init>() ,public byte getProtocolVersion() ,public void readExternal(java.io.ObjectInput) throws java.io.IOException, java.lang.ClassNotFoundException,public void writeExternal(java.io.ObjectOutput) throws java.io.IOException<variables>private static final int MAGIC,protected static fina... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/lang/IgniteUuid.java | IgniteUuid | compareTo | class IgniteUuid implements Comparable<IgniteUuid>, Iterable<IgniteUuid>, Cloneable, Externalizable, Binarylizable {
/** */
private static final long serialVersionUID = 0L;
/** VM ID. */
public static final UUID VM_ID = UUID.randomUUID();
/** */
private static final AtomicLong cntGen = new Ato... |
if (o == this)
return 0;
if (o == null)
return 1;
int res = Long.compare(locId, o.locId);
if (res == 0)
res = gid.compareTo(o.globalId());
return res;
| 1,514 | 80 | 1,594 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/logger/java/JavaLoggerFileHandler.java | JavaLoggerFileHandler | getIntProperty | class JavaLoggerFileHandler extends StreamHandler {
/** Log manager. */
private static final LogManager manager = LogManager.getLogManager();
/** Handler delegate. */
private volatile FileHandler delegate;
/** {@inheritDoc} */
@SuppressWarnings("NonSynchronizedMethodOverridesSynchronizedMethod... |
String val = manager.getProperty(name);
if (val == null)
return dfltVal;
try {
return Integer.parseInt(val.trim());
}
catch (Exception ex) {
ex.printStackTrace();
return dfltVal;
}
| 1,376 | 80 | 1,456 | <methods>public void <init>() ,public void <init>(java.io.OutputStream, java.util.logging.Formatter) ,public synchronized void close() throws java.lang.SecurityException,public synchronized void flush() ,public boolean isLoggable(java.util.logging.LogRecord) ,public synchronized void publish(java.util.logging.LogRecord... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/platform/dotnet/PlatformDotNetCacheStoreFactory.java | PlatformDotNetCacheStoreFactory | create | class PlatformDotNetCacheStoreFactory implements Factory<PlatformDotNetCacheStore> {
/** */
private static final long serialVersionUID = 0L;
/** .Net type name. */
private String typName;
/** Properties. */
private Map<String, ?> props;
/** Instance. */
private transient PlatformDotNe... |
synchronized (this) {
if (instance == null) {
instance = new PlatformDotNetCacheStore();
instance.setTypeName(typName);
instance.setProperties(props);
}
return instance;
}
| 340 | 65 | 405 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/plugin/security/SecurityBasicPermissionSet.java | SecurityBasicPermissionSet | equals | class SecurityBasicPermissionSet implements SecurityPermissionSet {
/** Serial version uid. */
private static final long serialVersionUID = 0L;
/** Cache permissions. */
@GridToStringInclude
private Map<String, Collection<SecurityPermission>> cachePermissions = new HashMap<>();
/** Task permis... |
if (this == o)
return true;
if (!(o instanceof SecurityBasicPermissionSet))
return false;
SecurityBasicPermissionSet other = (SecurityBasicPermissionSet)o;
return dfltAllowAll == other.dfltAllowAll &&
F.eq(cachePermissions, other.cachePermissions) ... | 1,218 | 136 | 1,354 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/IgniteSpiMBeanAdapter.java | IgniteSpiMBeanAdapter | getUpTime | class IgniteSpiMBeanAdapter implements IgniteSpiManagementMBean {
/** */
protected IgniteSpiAdapter spiAdapter;
/**
* Constructor
*
* @param spiAdapter Spi implementation.
*/
public IgniteSpiMBeanAdapter(IgniteSpiAdapter spiAdapter) {
this.spiAdapter = spiAdapter;
}
... |
final long startTstamp = spiAdapter.getStartTstamp();
return startTstamp == 0 ? 0 : U.currentTimeMillis() - startTstamp;
| 377 | 49 | 426 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/internal/ClusterStateProvider.java | ClusterStateProvider | safeLocalNodeId | class ClusterStateProvider {
/** Ignite. */
private final Ignite ignite;
/** Local node supplier. */
private final Supplier<ClusterNode> locNodeSupplier;
/** Tcp communication spi. */
private final TcpCommunicationSpi tcpCommSpi;
/** Stopped supplier. */
private final Supplier<Boolean... |
ClusterNode locNode = locNodeSupplier.get();
UUID id;
if (locNode == null) {
U.warn(log, "Local node is not started or fully initialized [isStopping=" +
isStopping() + ']');
id = new UUID(0, 0);
}
else
id = locNode.id();
... | 1,383 | 103 | 1,486 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/internal/HandshakeTimeoutObject.java | HandshakeTimeoutObject | run | class HandshakeTimeoutObject implements Runnable {
/** Object which used for connection. */
private final Object connectionObj;
/** Done. */
private final AtomicBoolean done = new AtomicBoolean();
/**
* @param connectionObj Client.
*/
public HandshakeTimeoutObject(Object connectionOb... |
if (done.compareAndSet(false, true)) {
// Close socket - timeout occurred.
if (connectionObj instanceof GridCommunicationClient)
((GridCommunicationClient)connectionObj).forceClose();
else
U.closeQuiet((AutoCloseable)connectionObj);
}
... | 243 | 76 | 319 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/messages/HandshakeMessage2.java | HandshakeMessage2 | readFrom | class HandshakeMessage2 extends HandshakeMessage {
/** */
private static final long serialVersionUID = 0L;
/** Message size in bytes including {@link HandshakeMessage} fields. */
public static final int HANDSHAKE2_MESSAGE_SIZE = MESSAGE_FULL_SIZE + 4;
/** */
private int connIdx;
/**
... |
if (!super.readFrom(buf, reader))
return false;
if (buf.remaining() < 4)
return false;
connIdx = buf.getInt();
return true;
| 502 | 57 | 559 | <methods>public void <init>() ,public void <init>(java.util.UUID, long, long) ,public long connectCount() ,public int connectionIndex() ,public short directType() ,public byte fieldsCount() ,public int getMessageSize() ,public java.util.UUID nodeId() ,public void onAckReceived() ,public boolean readFrom(java.nio.ByteBu... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/messages/NodeIdMessage.java | NodeIdMessage | nodeIdBytesWithType | class NodeIdMessage implements Message {
/** */
private static final long serialVersionUID = 0L;
/** Message body size (with message type) in bytes. */
static final int MESSAGE_SIZE = 16;
/** Full message size (with message type) in bytes. */
public static final int MESSAGE_FULL_SIZE = MESSAGE... |
byte[] nodeIdBytesWithType = new byte[MESSAGE_FULL_SIZE];
nodeIdBytesWithType[0] = (byte)(TcpCommunicationSpi.NODE_ID_MSG_TYPE & 0xFF);
nodeIdBytesWithType[1] = (byte)((TcpCommunicationSpi.NODE_ID_MSG_TYPE >> 8) & 0xFF);
U.uuidToBytes(nodeId, nodeIdBytesWithType, 2);
return n... | 652 | 134 | 786 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/communication/tcp/messages/RecoveryLastReceivedMessage.java | RecoveryLastReceivedMessage | writeTo | class RecoveryLastReceivedMessage implements Message {
/** */
private static final long serialVersionUID = 0L;
/** */
public static final long ALREADY_CONNECTED = -1;
/** */
public static final long NODE_STOPPING = -2;
/** Need wait. */
public static final long NEED_WAIT = -3;
/*... |
if (buf.remaining() < MESSAGE_FULL_SIZE)
return false;
TcpCommunicationSpi.writeMessageType(buf, directType());
buf.putLong(rcvCnt);
return true;
| 596 | 66 | 662 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/discovery/isolated/IsolatedDiscoverySpi.java | IsolatedDiscoverySpi | consistentId | class IsolatedDiscoverySpi extends IgniteSpiAdapter implements IgniteDiscoverySpi {
/** */
private Serializable consistentId;
/** */
private final long startTime = System.currentTimeMillis();
/** */
private IsolatedNode locNode;
/** */
private DiscoverySpiListener lsnr;
/** */
... |
if (consistentId == null) {
IgniteConfiguration cfg = ignite.configuration();
final Serializable cfgId = cfg.getConsistentId();
consistentId = cfgId != null ? cfgId : UUID.randomUUID();
}
return consistentId;
| 1,687 | 76 | 1,763 | <methods>public long clientFailureDetectionTimeout() ,public long failureDetectionTimeout() ,public void failureDetectionTimeoutEnabled(boolean) ,public boolean failureDetectionTimeoutEnabled() ,public org.apache.ignite.internal.util.IgniteExceptionRegistry getExceptionRegistry() ,public java.lang.String getName() ,pub... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractMessage.java | TcpDiscoveryAbstractMessage | equals | class TcpDiscoveryAbstractMessage implements Serializable {
/** */
private static final long serialVersionUID = 0L;
/** */
protected static final int CLIENT_FLAG_POS = 0;
/** */
protected static final int RESPONDED_FLAG_POS = 1;
/** */
protected static final int CLIENT_RECON_SUCCESS_F... |
if (this == obj)
return true;
else if (obj instanceof TcpDiscoveryAbstractMessage)
return id.equals(((TcpDiscoveryAbstractMessage)obj).id);
return false;
| 1,924 | 55 | 1,979 | <no_super_class> |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryAbstractTraceableMessage.java | TcpDiscoveryAbstractTraceableMessage | readResolve | class TcpDiscoveryAbstractTraceableMessage extends TcpDiscoveryAbstractMessage implements TraceableMessage {
/** Container. */
private SpanContainer spanContainer = new SpanContainer();
/**
* Default no-arg constructor for {@link Externalizable} interface.
*/
protected TcpDiscoveryAbstractTra... |
if (spanContainer == null)
spanContainer = new SpanContainer();
return this;
| 324 | 28 | 352 | <methods>public void addFailedNode(java.util.UUID) ,public boolean client() ,public void client(boolean) ,public java.util.UUID creatorNodeId() ,public boolean equals(java.lang.Object) ,public void failedNodes(Set<java.util.UUID>) ,public Collection<java.util.UUID> failedNodes() ,public boolean force() ,public void for... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryClientReconnectMessage.java | TcpDiscoveryClientReconnectMessage | equals | class TcpDiscoveryClientReconnectMessage extends TcpDiscoveryAbstractMessage {
/** */
private static final long serialVersionUID = 0L;
/** New router nodeID. */
private final UUID routerNodeId;
/** Last message ID. */
private final IgniteUuid lastMsgId;
/** Pending messages. */
@GridT... |
// NOTE!
// Do not call super. As IDs will differ, but we can ignore this.
if (!(obj instanceof TcpDiscoveryClientReconnectMessage))
return false;
TcpDiscoveryClientReconnectMessage other = (TcpDiscoveryClientReconnectMessage)obj;
return F.eq(creatorNodeId(), othe... | 566 | 130 | 696 | <methods>public void addFailedNode(java.util.UUID) ,public boolean client() ,public void client(boolean) ,public java.util.UUID creatorNodeId() ,public boolean equals(java.lang.Object) ,public void failedNodes(Set<java.util.UUID>) ,public Collection<java.util.UUID> failedNodes() ,public boolean force() ,public void for... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryConnectionCheckMessage.java | TcpDiscoveryConnectionCheckMessage | writeExternal | class TcpDiscoveryConnectionCheckMessage extends TcpDiscoveryAbstractMessage implements Externalizable {
/** */
private static final long serialVersionUID = 0L;
/**
* Default no-arg constructor for {@link Externalizable} interface.
*/
public TcpDiscoveryConnectionCheckMessage() {
// N... |
// This method has been left empty intentionally to keep message size at min.
| 312 | 21 | 333 | <methods>public void addFailedNode(java.util.UUID) ,public boolean client() ,public void client(boolean) ,public java.util.UUID creatorNodeId() ,public boolean equals(java.lang.Object) ,public void failedNodes(Set<java.util.UUID>) ,public Collection<java.util.UUID> failedNodes() ,public boolean force() ,public void for... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddFinishedMessage.java | TcpDiscoveryNodeAddFinishedMessage | clientDiscoData | class TcpDiscoveryNodeAddFinishedMessage extends TcpDiscoveryAbstractTraceableMessage {
/** */
private static final long serialVersionUID = 0L;
/** Added node ID. */
private final UUID nodeId;
/**
* Client node can not get discovery data from TcpDiscoveryNodeAddedMessage, we have to pass disc... |
this.clientDiscoData = clientDiscoData;
assert clientDiscoData == null || !clientDiscoData.hasDataFromNode(nodeId);
| 626 | 42 | 668 | <methods>public java.lang.Object readResolve() ,public org.apache.ignite.internal.processors.tracing.messages.SpanContainer spanContainer() <variables>private org.apache.ignite.internal.processors.tracing.messages.SpanContainer spanContainer |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/messages/TcpDiscoveryNodeAddedMessage.java | TcpDiscoveryNodeAddedMessage | clientTopology | class TcpDiscoveryNodeAddedMessage extends TcpDiscoveryAbstractTraceableMessage {
/** */
private static final long serialVersionUID = 0L;
/** Added node. */
private final TcpDiscoveryNode node;
/** */
private DiscoveryDataPacket dataPacket;
/** Pending messages from previous node. */
... |
assert top != null && !top.isEmpty() : top;
this.clientTop = top;
| 1,573 | 29 | 1,602 | <methods>public java.lang.Object readResolve() ,public org.apache.ignite.internal.processors.tracing.messages.SpanContainer spanContainer() <variables>private org.apache.ignite.internal.processors.tracing.messages.SpanContainer spanContainer |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/indexing/noop/NoopIndexingSpi.java | NoopIndexingSpi | query | class NoopIndexingSpi extends IgniteSpiAdapter implements IndexingSpi {
/** {@inheritDoc} */
@Override public Iterator<Cache.Entry<?, ?>> query(@Nullable String cacheName, Collection<Object> params,
@Nullable IndexingQueryFilter filters) throws IgniteSpiException {<FILL_FUNCTION_BODY>}
/** {@inheri... |
throw new IgniteSpiException("You have to configure custom GridIndexingSpi implementation.");
| 301 | 25 | 326 | <methods>public long clientFailureDetectionTimeout() ,public long failureDetectionTimeout() ,public void failureDetectionTimeoutEnabled(boolean) ,public boolean failureDetectionTimeoutEnabled() ,public org.apache.ignite.internal.util.IgniteExceptionRegistry getExceptionRegistry() ,public java.lang.String getName() ,pub... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/metric/jmx/MetricRegistryMBean.java | MetricRegistryMBean | searchHistogram | class MetricRegistryMBean extends ReadOnlyDynamicMBean {
/** Metric registry. */
ReadOnlyMetricRegistry mreg;
/**
* @param mreg Metric registry.
*/
public MetricRegistryMBean(ReadOnlyMetricRegistry mreg) {
this.mreg = mreg;
}
/** {@inheritDoc} */
@Override public Object g... |
int highBoundIdx;
boolean isInf = name.endsWith(INF);
if (isInf)
highBoundIdx = name.length() - 4;
else {
highBoundIdx = name.lastIndexOf(HISTOGRAM_NAME_DIVIDER);
if (highBoundIdx == -1)
return null;
}
int lowBoundI... | 944 | 477 | 1,421 | <methods>public non-sealed void <init>() ,public javax.management.AttributeList getAttributes(java.lang.String[]) ,public java.lang.Object invoke(java.lang.String, java.lang.Object[], java.lang.String[]) throws javax.management.MBeanException, javax.management.ReflectionException,public void setAttribute(javax.manageme... |
apache_ignite | ignite/modules/core/src/main/java/org/apache/ignite/spi/systemview/view/BinaryMetadataView.java | BinaryMetadataView | schemasIds | class BinaryMetadataView {
/** Meta. */
private final BinaryMetadata meta;
/** @param meta Meta. */
public BinaryMetadataView(BinaryMetadata meta) {
this.meta = meta;
}
/** @return Type id. */
@Order
public int typeId() {
return meta.typeId();
}
/** @return Typ... |
List<Integer> ids = new ArrayList<>(meta.schemas().size());
for (BinarySchema schema : meta.schemas())
ids.add(schema.schemaId());
return U.toStringSafe(ids);
| 337 | 58 | 395 | <no_super_class> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.