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 |
|---|---|---|---|---|---|---|---|---|---|
crate_crate | crate/benchmarks/src/main/java/io/crate/execution/engine/sort/SortingLimitAndOffsetCollectorBenchmark.java | SortingLimitAndOffsetCollectorBenchmark | measureBoundedSortingCollector | class SortingLimitAndOffsetCollectorBenchmark {
private static final Comparator<Object[]> COMPARATOR = (o1, o2) -> Integer.compare((int) o2[0], (int) o1[0]);
private static final RowCollectExpression INPUT = new RowCollectExpression(0);
private static final List<Input<?>> INPUTS = List.of(INPUT);
priva... |
BatchIterator<Row> it = new InMemoryBatchIterator<>(rows, SENTINEL, false);
BatchIterator<Row> sortingBatchIterator = CollectingBatchIterator.newInstance(it, boundedSortingCollector);
return sortingBatchIterator.loadNextBatch().toCompletableFuture().join();
| 618 | 77 | 695 | <no_super_class> |
crate_crate | crate/benchmarks/src/main/java/io/crate/operation/aggregation/HyperLogLogDistinctAggregationBenchmark.java | HyperLogLogDistinctAggregationBenchmark | benchmarkHLLPlusPlusMurmur128 | class HyperLogLogDistinctAggregationBenchmark {
private final List<Row1> rows = IntStream.range(0, 10_000).mapToObj(i -> new Row1(String.valueOf(i))).toList();
private HyperLogLogPlusPlus hyperLogLogPlusPlus;
private AggregateCollector onHeapCollector;
private OnHeapMemoryManager onHeapMemoryManager;
... |
for (int i = 0; i < rows.size(); i++) {
String value = DataTypes.STRING.sanitizeValue(rows.get(i).get(0));
byte[] bytes = value.getBytes(StandardCharsets.UTF_8);
MurmurHash3.Hash128 hash128 = MurmurHash3.hash128(bytes, 0, bytes.length, 0, hash);
hyperLogLogPlusPl... | 1,159 | 141 | 1,300 | <no_super_class> |
crate_crate | crate/extensions/jmx-monitoring/src/main/java/io/crate/beans/ThreadPools.java | ThreadPoolInfo | getThreadPoolInfo | class ThreadPoolInfo {
private final String name;
private final int poolSize;
private final int queueSize;
private final int largestPoolSize;
private final int active;
private final long completed;
private final long rejected;
@ConstructorProperties({"na... |
for (ThreadPoolStats.Stats stats : threadPool.stats()) {
if (stats.getName().equals(name)) {
return new ThreadPoolInfo(
stats.getName(),
stats.getThreads(),
stats.getQueue(),
stats.getLargest(),
... | 521 | 105 | 626 | <no_super_class> |
crate_crate | crate/libs/cli/src/main/java/org/elasticsearch/cli/Command.java | Command | main | class Command implements Closeable {
/** A description of the command, used in the help output. */
protected final String description;
private final Runnable beforeMain;
/** The option parser for this command. */
protected final OptionParser parser = new OptionParser();
private final OptionS... |
Thread shutdownHookThread = new Thread(() -> {
try {
this.close();
} catch (final IOException e) {
try (
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw)) {
e.printStack... | 744 | 330 | 1,074 | <no_super_class> |
crate_crate | crate/libs/cli/src/main/java/org/elasticsearch/cli/Terminal.java | SystemTerminal | readText | class SystemTerminal extends Terminal {
private static final PrintWriter WRITER = newWriter();
SystemTerminal() {
super(System.lineSeparator());
}
@SuppressForbidden(reason = "Writer for System.out")
private static PrintWriter newWriter() {
return new P... |
getWriter().print(text);
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in, Charset.defaultCharset()));
try {
final String line = reader.readLine();
if (line == null) {
throw new IllegalStateException("unab... | 142 | 122 | 264 | <no_super_class> |
crate_crate | crate/libs/dex/src/main/java/io/crate/data/AsyncFlatMapBatchIterator.java | AsyncFlatMapBatchIterator | moveNext | class AsyncFlatMapBatchIterator<I, O> implements BatchIterator<O> {
private final BatchIterator<I> source;
private final AsyncFlatMapper<I, O> mapper;
private NextAction nextAction = NextAction.SOURCE;
private O current = null;
private CloseableIterator<O> mappedElements;
private boolean sourc... |
while (true) {
if (nextAction == NextAction.SOURCE) {
if (source.moveNext()) {
nextAction = NextAction.MAPPER;
} else {
sourceExhausted = source.allLoaded();
}
return false;
} else {
... | 546 | 225 | 771 | <no_super_class> |
crate_crate | crate/libs/dex/src/main/java/io/crate/data/CapturingRowConsumer.java | CapturingRowConsumer | accept | class CapturingRowConsumer implements RowConsumer {
private final CompletableFuture<BatchIterator<Row>> batchIterator;
private final CompletableFuture<?> completionFuture;
private final boolean requiresScroll;
public CapturingRowConsumer(boolean requiresScroll, CompletableFuture<?> completionFuture) {... |
if (failure == null) {
batchIterator.complete(iterator);
} else {
batchIterator.completeExceptionally(failure);
}
| 269 | 42 | 311 | <no_super_class> |
crate_crate | crate/libs/dex/src/main/java/io/crate/data/CollectingBatchIterator.java | CollectingBatchIterator | newInstance | class CollectingBatchIterator<T> implements BatchIterator<T> {
private final Supplier<CompletableFuture<? extends Iterable<? extends T>>> loadItems;
private final Runnable onClose;
private final Consumer<? super Throwable> onKill;
private final boolean involvesIO;
private CompletableFuture<? exten... |
return newInstance(
source::close,
source::kill,
() -> source.collect(collector),
source.hasLazyResultSet()
);
| 1,152 | 46 | 1,198 | <no_super_class> |
crate_crate | crate/libs/dex/src/main/java/io/crate/data/CompositeBatchIterator.java | AsyncCompositeBI | loadNextBatch | class AsyncCompositeBI<T> extends AbstractCompositeBI<T> {
private final Executor executor;
private final IntSupplier availableThreads;
AsyncCompositeBI(Executor executor, IntSupplier availableThreads, BatchIterator<T>[] iterators) {
super(iterators);
this.executor = ex... |
if (allLoaded()) {
throw new IllegalStateException("BatchIterator already loaded");
}
int activeIts = numIteratorsActive();
int numThreads = Math.max(1, availableThreads.getAsInt());
final int usedThreads = Math.min(numThreads, activeIts);
... | 283 | 356 | 639 | <no_super_class> |
crate_crate | crate/libs/dex/src/main/java/io/crate/data/FilteringBatchIterator.java | FilteringBatchIterator | moveNext | class FilteringBatchIterator<T> extends ForwardingBatchIterator<T> {
private final BatchIterator<T> delegate;
private final Predicate<T> filter;
public FilteringBatchIterator(BatchIterator<T> delegate, Predicate<T> filter) {
this.delegate = delegate;
this.filter = filter;
}
@Overr... |
while (delegate.moveNext()) {
if (filter.test(delegate.currentElement())) {
return true;
}
}
return false;
| 140 | 47 | 187 | <methods>public non-sealed void <init>() ,public T currentElement() ,public boolean hasLazyResultSet() <variables> |
crate_crate | crate/libs/dex/src/main/java/io/crate/data/FlatMapBatchIterator.java | FlatMapBatchIterator | moveNext | class FlatMapBatchIterator<TIn, TOut> implements BatchIterator<TOut> {
private final BatchIterator<TIn> source;
private final Function<TIn, ? extends Iterator<TOut>> mapper;
private TOut current = null;
private boolean onSourceRow = false;
private Iterator<TOut> mappedElements;
public FlatMap... |
while (true) {
if (onSourceRow) {
if (mappedElements == null) {
mappedElements = mapper.apply(source.currentElement());
}
if (mappedElements.hasNext()) {
current = mappedElements.next();
retu... | 380 | 146 | 526 | <no_super_class> |
crate_crate | crate/libs/dex/src/main/java/io/crate/data/RowN.java | RowN | cells | class RowN extends Row {
private final int size;
private Object[] cells;
public RowN(int size) {
this.size = size;
}
public RowN(Object ... cells) {
this(cells.length);
this.cells = cells;
}
@Override
public int numColumns() {
return size;
}
p... |
assert cells != null : "cells must not be null";
this.cells = cells;
| 254 | 28 | 282 | <methods>public non-sealed void <init>() ,public final boolean equals(java.lang.Object) ,public abstract java.lang.Object get(int) ,public final int hashCode() ,public java.lang.Object[] materialize() ,public abstract int numColumns() <variables>public static final io.crate.data.Row EMPTY |
crate_crate | crate/libs/dex/src/main/java/io/crate/data/breaker/BlockBasedRamAccounting.java | BlockBasedRamAccounting | addBytes | class BlockBasedRamAccounting implements RamAccounting {
public static final int MAX_BLOCK_SIZE_IN_BYTES = 2 * 1024 * 1024;
/**
* 2 GB × 0.001 ➞ MB
* = 2 MB
*
* 256 MB × 0.001 ➞ MB
*
* = 0.256 MB
*/
private static final double BREAKER_LIMIT_PERCENTAGE = 0.001;
p... |
usedBytes += bytes;
if ((reservedBytes - usedBytes) < 0) {
long reserveBytes = bytes > blockSizeInBytes ? bytes : blockSizeInBytes;
try {
reserveMemory.accept(reserveBytes);
} catch (Exception e) {
usedBytes -= bytes;
t... | 583 | 120 | 703 | <no_super_class> |
crate_crate | crate/libs/dex/src/main/java/io/crate/data/join/CombinedRow.java | CombinedRow | get | class CombinedRow extends Row implements ElementCombiner<Row, Row, Row> {
private final int numCols;
private final int leftNumCols;
private Row left;
private Row right;
public CombinedRow(int leftNumCols, int rightNumCols) {
this.leftNumCols = leftNumCols;
this.numCols = leftNumCol... |
if (index < leftNumCols) {
if (left == null) {
return null;
}
return left.get(index);
}
index = index - leftNumCols;
if (right == null) {
return null;
}
return right.get(index);
| 317 | 81 | 398 | <methods>public non-sealed void <init>() ,public final boolean equals(java.lang.Object) ,public abstract java.lang.Object get(int) ,public final int hashCode() ,public java.lang.Object[] materialize() ,public abstract int numColumns() <variables>public static final io.crate.data.Row EMPTY |
crate_crate | crate/libs/dex/src/main/java/io/crate/data/join/LeftJoinNLBatchIterator.java | LeftJoinNLBatchIterator | tryAdvanceRight | class LeftJoinNLBatchIterator<L, R, C> extends JoinBatchIterator<L, R, C> {
private final Predicate<C> joinCondition;
private boolean hadMatch = false;
public LeftJoinNLBatchIterator(BatchIterator<L> left,
BatchIterator<R> right,
Elemen... |
while (tryMoveRight()) {
if (joinCondition.test(combiner.currentElement())) {
hadMatch = true;
return true;
}
}
if (right.allLoaded() == false) {
return false;
}
right.moveToStart();
if (hadMatch == fals... | 370 | 122 | 492 | <methods>public boolean allLoaded() ,public void close() ,public C currentElement() ,public boolean hasLazyResultSet() ,public void kill(java.lang.Throwable) ,public CompletionStage<?> loadNextBatch() throws java.lang.Exception,public void moveToStart() <variables>protected BatchIterator<?> activeIt,protected final non... |
crate_crate | crate/libs/es-x-content/src/main/java/org/elasticsearch/common/xcontent/ParseField.java | ParseField | match | class ParseField {
private final String name;
private final String[] deprecatedNames;
private String allReplacedWith = null;
private final String[] allNames;
private static final String[] EMPTY = new String[0];
/**
* @param name
* the primary name for this field. This will... |
Objects.requireNonNull(fieldName, "fieldName cannot be null");
// if this parse field has not been completely deprecated then try to
// match the preferred name
if (allReplacedWith == null && fieldName.equals(name)) {
return true;
}
// Now try to match agains... | 808 | 221 | 1,029 | <no_super_class> |
crate_crate | crate/libs/es-x-content/src/main/java/org/elasticsearch/common/xcontent/json/JsonXContentParser.java | JsonXContentParser | convertToken | class JsonXContentParser extends AbstractXContentParser {
final JsonParser parser;
public JsonXContentParser(NamedXContentRegistry xContentRegistry,
DeprecationHandler deprecationHandler, JsonParser parser) {
super(xContentRegistry, deprecationHandler);
this.parser = parser;
}
... |
if (token == null) {
return null;
}
switch (token) {
case FIELD_NAME:
return Token.FIELD_NAME;
case VALUE_FALSE:
case VALUE_TRUE:
return Token.VALUE_BOOLEAN;
case VALUE_STRING:
return Tok... | 1,141 | 282 | 1,423 | <methods>public void <init>(org.elasticsearch.common.xcontent.NamedXContentRegistry, org.elasticsearch.common.xcontent.DeprecationHandler) ,public boolean booleanValue() throws java.io.IOException,public double doubleValue() throws java.io.IOException,public double doubleValue(boolean) throws java.io.IOException,public... |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/AbstractModule.java | AbstractModule | configure | class AbstractModule implements Module {
Binder binder;
@Override
public final synchronized void configure(Binder builder) {<FILL_FUNCTION_BODY>}
/**
* Configures a {@link Binder} via the exposed methods.
*/
protected abstract void configure();
/**
* Gets direct access to the ... |
if (this.binder != null) {
throw new IllegalStateException("Re-entry is not allowed.");
}
this.binder = Objects.requireNonNull(builder, "builder");
try {
configure();
} finally {
this.binder = null;
}
| 1,434 | 78 | 1,512 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/BoundProviderFactory.java | BoundProviderFactory | notify | class BoundProviderFactory<T> implements InternalFactory<T>, CreationListener {
private final InjectorImpl injector;
final Key<? extends Provider<? extends T>> providerKey;
final Object source;
private InternalFactory<? extends Provider<? extends T>> providerFactory;
BoundProviderFactory(
... |
try {
providerFactory = injector.getInternalFactory(providerKey, errors.withSource(source));
} catch (ErrorsException e) {
errors.merge(e.getErrors());
}
| 317 | 53 | 370 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/DefaultConstructionProxyFactory.java | DefaultConstructionProxyFactory | create | class DefaultConstructionProxyFactory<T> implements ConstructionProxyFactory<T> {
private final InjectionPoint injectionPoint;
/**
* @param injectionPoint an injection point whose member is a constructor of {@code T}.
*/
DefaultConstructionProxyFactory(InjectionPoint injectionPoint) {
th... |
@SuppressWarnings("unchecked") // the injection point is for a constructor of T
final Constructor<T> constructor = (Constructor<T>) injectionPoint.getMember();
return new ConstructionProxy<T>() {
@Override
public T newInstance(Object... arguments) throws InvocationTarge... | 115 | 234 | 349 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/FactoryProxy.java | FactoryProxy | notify | class FactoryProxy<T> implements InternalFactory<T>, BindingProcessor.CreationListener {
private final InjectorImpl injector;
private final Key<T> key;
private final Key<? extends T> targetKey;
private final Object source;
private InternalFactory<? extends T> targetFactory;
FactoryProxy(Injec... |
try {
targetFactory = injector.getInternalFactory(targetKey, errors.withSource(source));
} catch (ErrorsException e) {
errors.merge(e.getErrors());
}
| 290 | 53 | 343 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/Initializables.java | Initializables | of | class Initializables {
/**
* Returns an initializable for an instance that requires no initialization.
*/
static <T> Initializable<T> of(final T instance) {<FILL_FUNCTION_BODY>}
} |
return new Initializable<T>() {
@Override
public T get(Errors errors) throws ErrorsException {
return instance;
}
@Override
public String toString() {
return String.valueOf(instance);
}
};
| 60 | 69 | 129 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/LookupProcessor.java | LookupProcessor | visit | class LookupProcessor extends AbstractProcessor {
LookupProcessor(Errors errors) {
super(errors);
}
@Override
public <T> Boolean visit(MembersInjectorLookup<T> lookup) {<FILL_FUNCTION_BODY>}
@Override
public <T> Boolean visit(ProviderLookup<T> lookup) {
// ensure the provider ... |
try {
MembersInjector<T> membersInjector
= injector.membersInjectorStore.get(lookup.getType(), errors);
lookup.initializeDelegate(membersInjector);
} catch (ErrorsException e) {
errors.merge(e.getErrors()); // TODO: source
}
retur... | 177 | 89 | 266 | <methods>public void process(Iterable<org.elasticsearch.common.inject.InjectorShell>) ,public void process(org.elasticsearch.common.inject.InjectorImpl, List<org.elasticsearch.common.inject.spi.Element>) ,public java.lang.Boolean visit(org.elasticsearch.common.inject.spi.Message) ,public java.lang.Boolean visit(org.ela... |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/PrivateElementProcessor.java | PrivateElementProcessor | visit | class PrivateElementProcessor extends AbstractProcessor {
private final Stage stage;
private final List<InjectorShell.Builder> injectorShellBuilders = new ArrayList<>();
PrivateElementProcessor(Errors errors, Stage stage) {
super(errors);
this.stage = stage;
}
@Override
public... |
InjectorShell.Builder builder = new InjectorShell.Builder()
.parent(injector)
.stage(stage)
.privateElements(privateElements);
injectorShellBuilders.add(builder);
return true;
| 136 | 63 | 199 | <methods>public void process(Iterable<org.elasticsearch.common.inject.InjectorShell>) ,public void process(org.elasticsearch.common.inject.InjectorImpl, List<org.elasticsearch.common.inject.spi.Element>) ,public java.lang.Boolean visit(org.elasticsearch.common.inject.spi.Message) ,public java.lang.Boolean visit(org.ela... |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/ScopeBindingProcessor.java | ScopeBindingProcessor | visit | class ScopeBindingProcessor extends AbstractProcessor {
ScopeBindingProcessor(Errors errors) {
super(errors);
}
@Override
public Boolean visit(ScopeBinding command) {<FILL_FUNCTION_BODY>}
} |
Scope scope = command.getScope();
Class<? extends Annotation> annotationType = command.getAnnotationType();
if (!Annotations.isScopeAnnotation(annotationType)) {
errors.withSource(annotationType).missingScopeAnnotation();
// Go ahead and bind anyway so we don't get coll... | 61 | 242 | 303 | <methods>public void process(Iterable<org.elasticsearch.common.inject.InjectorShell>) ,public void process(org.elasticsearch.common.inject.InjectorImpl, List<org.elasticsearch.common.inject.spi.Element>) ,public java.lang.Boolean visit(org.elasticsearch.common.inject.spi.Message) ,public java.lang.Boolean visit(org.ela... |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/SingleFieldInjector.java | SingleFieldInjector | inject | class SingleFieldInjector implements SingleMemberInjector {
final Field field;
final InjectionPoint injectionPoint;
final Dependency<?> dependency;
final InternalFactory<?> factory;
SingleFieldInjector(InjectorImpl injector, InjectionPoint injectionPoint, Errors errors)
throws ErrorsExc... |
errors = errors.withSource(dependency);
context.setDependency(dependency);
try {
Object value = factory.get(errors, context, dependency);
field.set(o, value);
} catch (ErrorsException e) {
errors.withSource(injectionPoint).merge(e.getErrors());
... | 209 | 133 | 342 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/assistedinject/Parameter.java | Parameter | getBindingAnnotation | class Parameter {
private final Type type;
private final boolean isAssisted;
private final Annotation bindingAnnotation;
private final boolean isProvider;
Parameter(Type type, Annotation[] annotations) {
this.type = type;
this.bindingAnnotation = getBindingAnnotation(annotations);
... |
Annotation bindingAnnotation = null;
for (Annotation a : annotations) {
if (a.annotationType().getAnnotation(BindingAnnotation.class) != null) {
if (bindingAnnotation != null) {
throw new IllegalArgumentException("Parameter has multiple binding annotation... | 646 | 103 | 749 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/internal/Annotations.java | Annotations | findBindingAnnotation | class Annotations {
/**
* Returns true if the given annotation is retained at runtime.
*/
public static boolean isRetainedAtRuntime(Class<? extends Annotation> annotationType) {
Retention retention = annotationType.getAnnotation(Retention.class);
return retention != null && retention.... |
Annotation found = null;
for (Annotation annotation : annotations) {
if (annotation.annotationType().getAnnotation(BindingAnnotation.class) != null) {
if (found != null) {
errors.duplicateBindingAnnotations(member,
found.annot... | 710 | 105 | 815 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/internal/BindingBuilder.java | BindingBuilder | toInstance | class BindingBuilder<T> extends AbstractBindingBuilder<T>
implements AnnotatedBindingBuilder<T> {
public BindingBuilder(Binder binder, List<Element> elements, Object source, Key<T> key) {
super(binder, elements, source, key);
}
@Override
public BindingBuilder<T> annotatedWith(Class<? e... |
checkNotTargetted();
// lookup the injection points, adding any errors to the binder's errors list
Set<InjectionPoint> injectionPoints;
if (instance != null) {
try {
injectionPoints = InjectionPoint.forInstanceMethodsAndFields(instance.getClass());
... | 794 | 222 | 1,016 | <methods>public void <init>(org.elasticsearch.common.inject.Binder, List<org.elasticsearch.common.inject.spi.Element>, java.lang.Object, Key<T>) ,public void asEagerSingleton() ,public void in(Class<? extends java.lang.annotation.Annotation>) ,public void in(org.elasticsearch.common.inject.Scope) <variables>public stat... |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/internal/BindingImpl.java | BindingImpl | getProvider | class BindingImpl<T> implements Binding<T> {
private final Injector injector;
private final Key<T> key;
private final Object source;
private final Scoping scoping;
private final InternalFactory<? extends T> internalFactory;
public BindingImpl(Injector injector, Key<T> key, Object source,
... |
if (provider == null) {
if (injector == null) {
throw new UnsupportedOperationException("getProvider() not supported for module bindings");
}
provider = injector.getProvider(key);
}
return provider;
| 644 | 66 | 710 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/internal/ExposedBindingImpl.java | ExposedBindingImpl | toString | class ExposedBindingImpl<T> extends BindingImpl<T> implements ExposedBinding<T> {
private final PrivateElements privateElements;
public ExposedBindingImpl(Injector injector, Object source, Key<T> key,
InternalFactory<T> factory, PrivateElements privateElements) {
super(in... |
return new ToStringBuilder(ExposedBinding.class)
.add("key", getKey())
.add("source", getSource())
.add("privateElements", privateElements)
.toString();
| 437 | 53 | 490 | <methods>public void <init>(org.elasticsearch.common.inject.Injector, Key<T>, java.lang.Object, InternalFactory<? extends T>, org.elasticsearch.common.inject.internal.Scoping) ,public V acceptScopingVisitor(BindingScopingVisitor<V>) ,public V acceptVisitor(ElementVisitor<V>) ,public org.elasticsearch.common.inject.Inje... |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/internal/FailableCache.java | FailableCache | get | class FailableCache<K, V> {
private final ConcurrentHashMap<K, Object> cache = new ConcurrentHashMap<>();
protected abstract V create(K key, Errors errors) throws ErrorsException;
public V get(K key, Errors errors) throws ErrorsException {<FILL_FUNCTION_BODY>}
private Object load(K key) {
E... |
Object resultOrError = cache.get(key);
if (resultOrError == null) {
synchronized (this) {
resultOrError = load(key);
// we can't use cache.computeIfAbsent since this might be recursively call this API
cache.putIfAbsent(key, resultOrError);
... | 170 | 171 | 341 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/internal/InstanceBindingImpl.java | InstanceBindingImpl | getDependencies | class InstanceBindingImpl<T> extends BindingImpl<T> implements InstanceBinding<T> {
final T instance;
final Provider<T> provider;
final Set<InjectionPoint> injectionPoints;
public InstanceBindingImpl(Injector injector, Key<T> key, Object source,
InternalFactory<? extends... |
return instance instanceof HasDependencies
? unmodifiableSet(new HashSet<>((((HasDependencies) instance).getDependencies())))
: Dependency.forInjectionPoints(injectionPoints);
| 619 | 52 | 671 | <methods>public void <init>(org.elasticsearch.common.inject.Injector, Key<T>, java.lang.Object, InternalFactory<? extends T>, org.elasticsearch.common.inject.internal.Scoping) ,public V acceptScopingVisitor(BindingScopingVisitor<V>) ,public V acceptVisitor(ElementVisitor<V>) ,public org.elasticsearch.common.inject.Inje... |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/internal/InternalContext.java | InternalContext | getConstructionContext | class InternalContext {
private Map<Object, ConstructionContext<?>> constructionContexts = new HashMap<>();
private Dependency dependency;
@SuppressWarnings("unchecked")
public <T> ConstructionContext<T> getConstructionContext(Object key) {<FILL_FUNCTION_BODY>}
public Dependency getDependency() {... |
ConstructionContext<T> constructionContext
= (ConstructionContext<T>) constructionContexts.get(key);
if (constructionContext == null) {
constructionContext = new ConstructionContext<>();
constructionContexts.put(key, constructionContext);
}
return... | 124 | 74 | 198 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/internal/Nullability.java | Nullability | allowsNull | class Nullability {
private Nullability() {
}
public static boolean allowsNull(Annotation[] annotations) {<FILL_FUNCTION_BODY>}
} |
for (Annotation a : annotations) {
if ("Nullable".equals(a.annotationType().getSimpleName())) {
return true;
}
}
return false;
| 44 | 48 | 92 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/internal/PrivateElementsImpl.java | PrivateElementsImpl | getElements | class PrivateElementsImpl implements PrivateElements {
/*
* This class acts as both a value object and as a builder. When getElements() is called, an
* immutable collection of elements is constructed and the original mutable list is nulled out.
* Similarly, the exposed keys are made immutable on access... |
if (elements == null) {
elements = Collections.unmodifiableList(elementsMutable);
elementsMutable = null;
}
return elements;
| 913 | 45 | 958 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/internal/StackTraceElements.java | StackTraceElements | forMember | class StackTraceElements {
public static Object forMember(Member member) {<FILL_FUNCTION_BODY>}
public static Object forType(Class<?> implementation) {
String fileName = null;
int lineNumber = -1;
return new StackTraceElement(implementation.getName(), "class", fileName, lineNumber);
... |
if (member == null) {
return SourceProvider.UNKNOWN_SOURCE;
}
Class declaringClass = member.getDeclaringClass();
String fileName = null;
int lineNumber = -1;
Class<? extends Member> memberType = MoreTypes.memberType(member);
String memberName = mem... | 92 | 129 | 221 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/internal/Stopwatch.java | Stopwatch | reset | class Stopwatch {
private static final Logger LOGGER = Logger.getLogger(Stopwatch.class.getName());
private static final long NSEC_PER_MSEC = 1000000L;
private long startNS = System.nanoTime();
/**
* Resets and returns elapsed time in milliseconds.
*/
public long reset() {<FILL_FUNCTION... |
long nowNS = System.nanoTime();
long deltaNS = nowNS - startNS;
try {
return deltaNS / NSEC_PER_MSEC;
} finally {
startNS = nowNS;
}
| 168 | 63 | 231 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/internal/UniqueAnnotations.java | UniqueAnnotations | toString | class UniqueAnnotations {
private UniqueAnnotations() {
}
private static final AtomicInteger NEXT_UNIQUE_VALUE = new AtomicInteger(1);
/**
* Returns an annotation instance that is not equal to any other annotation
* instances, for use in creating distinct {@link org.elasticsearch.common.inj... |
return "@" + Internal.class.getName() + "(value=" + value + ")";
| 326 | 27 | 353 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/matcher/AbstractMatcher.java | AndMatcher | toString | class AndMatcher<T> extends AbstractMatcher<T> {
private final Matcher<? super T> a;
private final Matcher<? super T> b;
AndMatcher(Matcher<? super T> a, Matcher<? super T> b) {
this.a = a;
this.b = b;
}
@Override
public boolean matches(T t) {
... |
return "and(" + a + ", " + b + ")";
| 250 | 19 | 269 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/name/Names.java | Names | bindProperties | class Names {
private Names() {
}
/**
* Creates a {@link Named} annotation with {@code name} as the value.
*/
public static Named named(String name) {
return new NamedImpl(name);
}
/**
* Creates a constant binding to {@code @Named(key)} for each entry in
* {@code p... |
binder = binder.skipSources(Names.class);
// use enumeration to include the default properties
for (Enumeration<?> e = properties.propertyNames(); e.hasMoreElements(); ) {
String propertyName = (String) e.nextElement();
String value = properties.getProperty(propertyName... | 293 | 115 | 408 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/spi/Dependency.java | Dependency | equals | class Dependency<T> {
private final InjectionPoint injectionPoint;
private final Key<T> key;
private final boolean nullable;
private final int parameterIndex;
Dependency(InjectionPoint injectionPoint, Key<T> key,
boolean nullable, int parameterIndex) {
this.injectionPoint = i... |
if (o instanceof Dependency) {
Dependency dependency = (Dependency) o;
return Objects.equals(injectionPoint, dependency.injectionPoint)
&& Objects.equals(parameterIndex, dependency.parameterIndex)
&& Objects.equals(key, dependency.key);
} ... | 680 | 87 | 767 | <no_super_class> |
crate_crate | crate/libs/guice/src/main/java/org/elasticsearch/common/inject/util/Providers.java | Providers | of | class Providers {
private Providers() {
}
/**
* Returns a provider which always provides {@code instance}. This should not
* be necessary to use in your application, but is helpful for several types
* of unit tests.
*
* @param instance the instance that should always be provided.... |
return new Provider<T>() {
@Override
public T get() {
return instance;
}
@Override
public String toString() {
return "of(" + instance + ")";
}
};
| 153 | 63 | 216 | <no_super_class> |
crate_crate | crate/libs/pgwire/src/main/java/io/crate/protocols/postgres/parser/PgArrayParser.java | PgArrayParser | invokeParser | class PgArrayParser {
private static final BaseErrorListener ERROR_LISTENER = new BaseErrorListener() {
@Override
public void syntaxError(Recognizer<?, ?> recognizer,
Object offendingSymbol,
int line,
in... |
try {
var lexer = new PgArrayLexer(input);
var tokenStream = new CommonTokenStream(lexer);
var parser = new io.crate.protocols.postgres.antlr.PgArrayParser(tokenStream);
lexer.removeErrorListeners();
lexer.addErrorListener(ERROR_LISTENER);
... | 270 | 311 | 581 | <no_super_class> |
crate_crate | crate/libs/shared/src/main/java/io/crate/common/Booleans.java | Booleans | parseBoolean | class Booleans {
private Booleans() {
throw new AssertionError("No instances intended");
}
/**
* Parses a char[] representation of a boolean value to <code>boolean</code>.
*
* @return <code>true</code> iff the sequence of chars is "true", <code>false</code> iff the sequence of chars... |
if (text == null || length == 0) {
return defaultValue;
} else {
return parseBoolean(new String(text, offset, length));
}
| 1,051 | 45 | 1,096 | <no_super_class> |
crate_crate | crate/libs/shared/src/main/java/io/crate/common/Glob.java | Glob | globMatch | class Glob {
/**
* Match a String against the given pattern, supporting the following simple
* pattern styles: "xxx*", "*xxx", "*xxx*" and "xxx*yyy" matches (with an
* arbitrary number of pattern parts), as well as direct equality.
*
* @param pattern the pattern to match against
* @pa... |
if (pattern == null || str == null) {
return false;
}
int firstIndex = pattern.indexOf('*');
if (firstIndex == -1) {
return pattern.equals(str);
}
if (firstIndex == 0) {
if (pattern.length() == 1) {
return true;
... | 138 | 339 | 477 | <no_super_class> |
crate_crate | crate/libs/shared/src/main/java/io/crate/common/Octal.java | Octal | decode | class Octal {
private Octal() {
}
/**
* Converts an array of bytes into a String where unprintable characters are represented as octal numbers.
*/
public static String encode(byte[] data) {
final StringBuilder sb = new StringBuilder(data.length);
for (byte b: data) {
... |
final byte[] decodedBytes = new byte[octalData.length()];
final char[] encodedChars = octalData.toCharArray();
int decIndex = 0;
for (int encIndex = 0; encIndex < encodedChars.length; encIndex++) {
final char c = encodedChars[encIndex];
if (c == '\\') {
... | 452 | 354 | 806 | <no_super_class> |
crate_crate | crate/libs/shared/src/main/java/io/crate/common/StringUtils.java | StringUtils | isBlank | class StringUtils {
private StringUtils() {}
public static final ThreadLocal<long[]> PARSE_LONG_BUFFER = ThreadLocal.withInitial(() -> new long[1]);
public static List<String> splitToList(char delim, String value) {
ArrayList<String> result = new ArrayList<>();
int lastStart = 0;
... |
for (int i = start; i < end; i++) {
if (!Character.isSpaceChar(string.charAt(i))) {
return false;
}
}
return true;
| 1,148 | 54 | 1,202 | <no_super_class> |
crate_crate | crate/libs/shared/src/main/java/io/crate/common/Suppliers.java | ExpiringMemoizingSupplier | get | class ExpiringMemoizingSupplier<T> implements Supplier<T>, Serializable {
final Supplier<T> delegate;
final long durationNanos;
transient volatile @Nullable T value;
// The special value 0 means "not yet initialized".
transient volatile long expirationNanos;
ExpiringMemo... |
// Another variant of Double Checked Locking.
//
// We use two volatile reads. We could reduce this to one by
// putting our fields into a holder class, but (at least on x86)
// the extra memory consumption and indirection are more
// expensive th... | 303 | 247 | 550 | <no_super_class> |
crate_crate | crate/libs/shared/src/main/java/io/crate/common/collections/LexicographicalOrdering.java | LexicographicalOrdering | compare | class LexicographicalOrdering<T> extends Ordering<Iterable<T>> implements Serializable {
final Comparator<? super T> elementOrder;
public LexicographicalOrdering(Comparator<? super T> elementOrder) {
this.elementOrder = elementOrder;
}
@Override
public int compare(Iterable<T> leftIterable,... |
Iterator<T> left = leftIterable.iterator();
Iterator<T> right = rightIterable.iterator();
while (left.hasNext()) {
if (!right.hasNext()) {
return LEFT_IS_GREATER; // because it's longer
}
int result = elementOrder.compare(left.next(), right.ne... | 295 | 152 | 447 | <methods>public abstract int compare(Iterable<T>, Iterable<T>) ,public static Ordering<T> compound(Iterable<? extends Comparator<? super T>>) <variables>static final int LEFT_IS_GREATER,static final int RIGHT_IS_GREATER |
crate_crate | crate/libs/shared/src/main/java/io/crate/common/collections/Lists.java | RotatedList | get | class RotatedList<T> extends AbstractList<T> implements RandomAccess {
private final List<T> in;
private final int distance;
RotatedList(List<T> list, int distance) {
if (distance < 0 || distance >= list.size()) {
throw new IllegalArgumentException();
}
... |
int idx = distance + index;
if (idx < 0 || idx >= in.size()) {
idx -= in.size();
}
return in.get(idx);
| 170 | 48 | 218 | <no_super_class> |
crate_crate | crate/libs/shared/src/main/java/io/crate/common/collections/RefCountedItem.java | RefCountedItem | close | class RefCountedItem<T> implements AutoCloseable {
private final Function<String, T> itemFactory;
private final Consumer<T> closeItem;
private final ArrayList<String> sources = new ArrayList<>();
private int refs = 0;
private T item;
public RefCountedItem(Function<String, T> itemFactory, Cons... |
synchronized (sources) {
refs--;
if (refs == 0) {
try {
closeItem.accept(item);
} finally {
item = null;
}
}
}
| 373 | 60 | 433 | <no_super_class> |
crate_crate | crate/libs/shared/src/main/java/io/crate/common/collections/Sets.java | Sets | difference | class Sets {
private Sets() {
}
public static <T> Set<T> newConcurrentHashSet() {
return Collections.newSetFromMap(new ConcurrentHashMap<>());
}
public static <T> boolean haveEmptyIntersection(Set<T> left, Set<T> right) {
Objects.requireNonNull(left);
Objects.requireNonNu... |
Objects.requireNonNull(set1, "set1");
Objects.requireNonNull(set2, "set2");
return new AbstractSet<E>() {
@Override
public Iterator<E> iterator() {
return new AbstractIterator<E>() {
final Iterator<E> itr = set1.iterator();
... | 491 | 372 | 863 | <no_super_class> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/AlterTableRenameColumn.java | AlterTableRenameColumn | toString | class AlterTableRenameColumn<T> extends Statement {
private final Table<T> table;
private final Expression column;
private final Expression newName;
public AlterTableRenameColumn(Table<T> table, Expression column, Expression newName) {
this.table = table;
this.column = column;
... |
return "AlterTableRenameColumn{" +
"table=" + table +
", column=" + column +
", newName=" + newName +
'}';
| 371 | 49 | 420 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/AlterTableReroute.java | AlterTableReroute | toString | class AlterTableReroute<T> extends Statement {
private final Table<T> table;
private final RerouteOption rerouteOption;
private final boolean blob;
public AlterTableReroute(Table<T> table,
boolean blob,
RerouteOption rerouteOption) {
th... |
return "AlterTableReroute{" +
"table=" + table +
", blob=" + blob +
", reroute option=" + rerouteOption +
'}';
| 412 | 53 | 465 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/ArithmeticExpression.java | ArithmeticExpression | equals | class ArithmeticExpression
extends Expression {
public enum Type {
ADD("+"),
SUBTRACT("-"),
MULTIPLY("*"),
DIVIDE("/"),
MODULUS("%"),
POWER("^");
private final String value;
Type(String value) {
this.value = value;
}
p... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ArithmeticExpression that = (ArithmeticExpression) o;
if (!left.equals(that.left)) {
return false;
}
if (!right.equals(tha... | 371 | 131 | 502 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public final java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/ArrayComparisonExpression.java | ArrayComparisonExpression | equals | class ArrayComparisonExpression extends ComparisonExpression implements ArrayComparison {
private final Quantifier quantifier;
public ArrayComparisonExpression(Type type,
Quantifier quantifier,
Expression expression,
... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
ArrayComparisonExpression that = (ArrayComparisonExpression) o;
if (quantifier != that.quantifier) return false;
return true;
| 236 | 86 | 322 | <methods>public void <init>(io.crate.sql.tree.ComparisonExpression.Type, io.crate.sql.tree.Expression, io.crate.sql.tree.Expression) ,public R accept(AstVisitor<R,C>, C) ,public boolean equals(java.lang.Object) ,public io.crate.sql.tree.Expression getLeft() ,public io.crate.sql.tree.Expression getRight() ,public io.cra... |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/BitString.java | BitString | ofBitString | class BitString extends Literal implements Comparable<BitString> {
public static BitString ofBitString(String bitString) {<FILL_FUNCTION_BODY>}
public static BitString ofRawBits(String bits) {
return ofRawBits(bits, bits.length());
}
public static BitString ofRawBits(String bits, int length) ... |
assert bitString.startsWith("B'") : "Bitstring must start with B'";
assert bitString.endsWith("'") : "Bitstrign must end with '";
return ofRawBits(bitString.substring(2, bitString.length() - 1));
| 998 | 72 | 1,070 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public static io.crate.sql.tree.Literal fromObject(java.lang.Object) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/BooleanLiteral.java | BooleanLiteral | equals | class BooleanLiteral extends Literal {
public static final BooleanLiteral TRUE_LITERAL = new BooleanLiteral(true);
public static final BooleanLiteral FALSE_LITERAL = new BooleanLiteral(false);
private final boolean value;
private BooleanLiteral(boolean value) {
this.value = value;
}
... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
BooleanLiteral that = (BooleanLiteral) o;
return value == that.value;
| 196 | 68 | 264 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public static io.crate.sql.tree.Literal fromObject(java.lang.Object) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/CharFilters.java | CharFilters | equals | class CharFilters<T> extends AnalyzerElement<T> {
private final List<NamedProperties<T>> charFilters;
public CharFilters(List<NamedProperties<T>> charFilters) {
this.charFilters = charFilters;
}
public List<NamedProperties<T>> charFilters() {
return charFilters;
}
@Override
... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CharFilters<?> that = (CharFilters<?>) o;
return Objects.equals(charFilters, that.charFilters);
| 241 | 85 | 326 | <methods>public non-sealed void <init>() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/Close.java | Close | equals | class Close extends Statement {
private final String cursorName;
/**
* @param cursorName name of cursor to close; null implies ALL
*/
public Close(@Nullable String cursorName) {
this.cursorName = cursorName;
}
@Nullable
public String cursorName() {
return cursorName;... |
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
Close other = (Close) obj;
return Objects.equals(cursorName, other.cursorName);
| 221 | 86 | 307 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/ColumnDefinition.java | ColumnDefinition | validateColumnConstraints | class ColumnDefinition<T> extends TableElement<T> {
private final String ident;
@Nullable
private final ColumnType<T> type;
private final List<ColumnConstraint<T>> constraints;
public ColumnDefinition(String ident,
@Nullable ColumnType<T> type,
... |
var hasConstraint = new boolean[5];
for (ColumnConstraint<T> constraint : constraints) {
switch (constraint) {
case PrimaryKeyColumnConstraint<T> ignored -> {
if (hasConstraint[0]) {
throw new IllegalArgumentException("Column [" + ... | 553 | 502 | 1,055 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public abstract void visit(Consumer<? super T>) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/ColumnStorageDefinition.java | ColumnStorageDefinition | equals | class ColumnStorageDefinition<T> extends ColumnConstraint<T> {
private final GenericProperties<T> properties;
public ColumnStorageDefinition(GenericProperties<T> properties) {
this.properties = properties;
}
public GenericProperties<T> properties() {
return properties;
}
@Ove... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ColumnStorageDefinition<?> that = (ColumnStorageDefinition<?>) o;
return Objects.equals(properties, that.properties);
| 305 | 81 | 386 | <methods>public R accept(AstVisitor<R,C>, C) ,public abstract ColumnConstraint<U> map(Function<? super T,? extends U>) ,public abstract void visit(Consumer<? super T>) <variables>permits CheckColumnConstraint,permits ColumnStorageDefinition,permits DefaultConstraint,permits GeneratedExpressionConstraint,permits IndexCo... |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/ComparisonExpression.java | ComparisonExpression | equals | class ComparisonExpression extends Expression {
public enum Type {
EQUAL("="),
NOT_EQUAL("<>"),
LESS_THAN("<"),
LESS_THAN_OR_EQUAL("<="),
GREATER_THAN(">"),
GREATER_THAN_OR_EQUAL(">="),
CONTAINED_WITHIN("<<"),
IS_DISTINCT_FROM("IS DISTINCT FROM"),
... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ComparisonExpression that = (ComparisonExpression) o;
return type == that.type &&
Objects.equals(left, that.left) &&
Objec... | 471 | 96 | 567 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public final java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/CreateAnalyzer.java | CreateAnalyzer | equals | class CreateAnalyzer<T> extends Statement {
private final String ident;
@Nullable
private final String extendedAnalyzer;
private final List<AnalyzerElement<T>> elements;
public CreateAnalyzer(String ident,
@Nullable String extendedAnalyzer,
List<... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateAnalyzer<?> that = (CreateAnalyzer<?>) o;
return Objects.equals(ident, that.ident) &&
Objects.equals(extendedAnalyzer, that.extende... | 372 | 115 | 487 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/CreatePublication.java | CreatePublication | toString | class CreatePublication extends Statement {
private final String name;
private final boolean forAllTables;
private final List<QualifiedName> tables;
public CreatePublication(String name, boolean forAllTables, List<QualifiedName> tables) {
this.name = name;
this.forAllTables = forAllTab... |
return "CreatePublication{" +
"name='" + name + '\'' +
", forAllTables=" + forAllTables +
", tables=" + tables +
'}';
| 377 | 53 | 430 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/CreateSnapshot.java | CreateSnapshot | equals | class CreateSnapshot<T> extends Statement {
private final QualifiedName name;
private final GenericProperties<T> properties;
private final List<Table<T>> tables;
public CreateSnapshot(QualifiedName name,
GenericProperties<T> properties) {
this.name = name;
thi... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
CreateSnapshot<?> that = (CreateSnapshot<?>) o;
return Objects.equals(name, that.name) &&
Objects.equals(properties, that.properties) &&
... | 385 | 107 | 492 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/CreateTableAs.java | CreateTableAs | equals | class CreateTableAs<T> extends Statement {
private final Table<T> name;
private final Query query;
public CreateTableAs(Table<T> name, Query query) {
this.name = name;
this.query = query;
}
public Table<T> name() {
return this.name;
}
public Query query() {
... |
if (this == o) {
return true;
}
if (!(o instanceof CreateTableAs)) {
return false;
}
CreateTableAs<?> that = (CreateTableAs<?>) o;
return name.equals(that.name) &&
query.equals(that.query);
| 259 | 82 | 341 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/CreateView.java | CreateView | hashCode | class CreateView extends Statement {
private final QualifiedName name;
private final Query query;
private final boolean replaceExisting;
public CreateView(QualifiedName name, Query query, boolean replaceExisting) {
this.name = name;
this.query = query;
this.replaceExisting = re... |
int result = name.hashCode();
result = 31 * result + query.hashCode();
result = 31 * result + (replaceExisting ? 1 : 0);
return result;
| 383 | 52 | 435 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/DiscardStatement.java | DiscardStatement | equals | class DiscardStatement extends Statement {
public enum Target {
ALL,
PLANS,
SEQUENCES,
TEMPORARY
}
private final Target target;
public DiscardStatement(Target target) {
this.target = target;
}
public Target target() {
return target;
}
... |
return obj instanceof DiscardStatement && ((DiscardStatement) obj).target == this.target;
| 229 | 25 | 254 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/DropFunction.java | DropFunction | equals | class DropFunction extends Statement {
private final QualifiedName name;
private final boolean exists;
private final List<FunctionArgument> arguments;
public DropFunction(QualifiedName name, boolean exists, List<FunctionArgument> arguments) {
this.name = name;
this.exists = exists;
... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
DropFunction that = (DropFunction) o;
if (exists != that.exists) return false;
if (!name.equals(that.name)) return false;
return arguments.equals(that.arguments);
| 336 | 89 | 425 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/DropRole.java | DropRole | toString | class DropRole extends Statement {
private final String name;
private final boolean ifExists;
public DropRole(String name, boolean ifExists) {
this.name = name;
this.ifExists = ifExists;
}
public String name() {
return name;
}
public boolean ifExists() {
r... |
return "DropRole{" +
"name='" + name + '\'' +
", ifExists=" + ifExists +
'}';
| 298 | 39 | 337 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/DropView.java | DropView | hashCode | class DropView extends Statement {
private final List<QualifiedName> names;
private final boolean ifExists;
public DropView(List<QualifiedName> names, boolean ifExists) {
this.names = names;
this.ifExists = ifExists;
}
public List<QualifiedName> names() {
return names;
... |
int result = names.hashCode();
result = 31 * result + (ifExists ? 1 : 0);
return result;
| 329 | 37 | 366 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/Except.java | Except | equals | class Except extends SetOperation {
private final Relation left;
private final Relation right;
public Except(Relation left, Relation right) {
this.left = requireNonNull(left, "relation must not be null");
this.right = requireNonNull(right, "relation must not be null");
}
public Re... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Except except = (Except) o;
return Objects.equals(left, except.left) &&
Objects.equals(right, except.right);
| 269 | 87 | 356 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/Explain.java | Explain | toString | class Explain extends Statement {
public enum Option {
ANALYZE,
COSTS,
VERBOSE
}
private final Statement statement;
// Possible values for options is `true`, `false`, `null`
private final Map<Option, Boolean> options;
public Explain(Statement statement, Map<Option, Boo... |
return "Explain{" +
"statement=" + statement +
", options=" + options +
'}';
| 492 | 34 | 526 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/FunctionArgument.java | FunctionArgument | equals | class FunctionArgument extends Node {
@Nullable
private final String name;
private final ColumnType<?> type;
public FunctionArgument(@Nullable String name, ColumnType<?> type) {
this.name = name;
this.type = type;
}
@Nullable
public String name() {
return name;
... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
final FunctionArgument that = (FunctionArgument) o;
return Objects.equals(this.name, that.name)
&& Objects.equals(this.type, that.type);
| 259 | 81 | 340 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public abstract boolean equals(java.lang.Object) ,public abstract int hashCode() ,public abstract java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/GenericProperties.java | GenericProperties | equals | class GenericProperties<T> extends Node {
private static final GenericProperties<?> EMPTY = new GenericProperties<>(Map.of());
@SuppressWarnings("unchecked")
public static <T> GenericProperties<T> empty() {
return (GenericProperties<T>) EMPTY;
}
private final Map<String, T> properties;
... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
GenericProperties<?> that = (GenericProperties<?>) o;
return Objects.equals(properties, that.properties);
| 597 | 80 | 677 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public abstract boolean equals(java.lang.Object) ,public abstract int hashCode() ,public abstract java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/GrantPrivilege.java | GrantPrivilege | toString | class GrantPrivilege extends PrivilegeStatement {
public GrantPrivilege(List<String> userNames, String securable, List<QualifiedName> tableOrSchemaNames) {
super(userNames, securable, tableOrSchemaNames);
}
public GrantPrivilege(List<String> userNames,
List<String> permis... |
return "GrantPrivilege{" +
"allPrivileges=" + all +
"permissions=" + permissions +
", userNames=" + userNames +
'}';
| 215 | 54 | 269 | <methods>public boolean all() ,public boolean equals(java.lang.Object) ,public int hashCode() ,public List<io.crate.sql.tree.QualifiedName> privilegeIdents() ,public List<java.lang.String> privileges() ,public java.lang.String securable() ,public List<java.lang.String> userNames() <variables>permits DenyPrivilege,permi... |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/IndexDefinition.java | IndexDefinition | equals | class IndexDefinition<T> extends TableElement<T> {
private final String ident;
private final String method;
private final List<T> columns;
private final GenericProperties<T> properties;
public IndexDefinition(String ident, String method, List<T> columns, GenericProperties<T> properties) {
... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
IndexDefinition<?> that = (IndexDefinition<?>) o;
return Objects.equals(ident, that.ident) &&
Objects.equals(method, that.method) &&
... | 410 | 121 | 531 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public abstract void visit(Consumer<? super T>) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/Insert.java | DuplicateKeyContext | toString | class DuplicateKeyContext<T> {
private static final DuplicateKeyContext<?> NONE =
new DuplicateKeyContext<>(Type.NONE, Collections.emptyList(), Collections.emptyList());
@SuppressWarnings("unchecked")
public static <T> DuplicateKeyContext<T> none() {
return (DuplicateKe... |
return "DuplicateKeyContext{" +
"type=" + type +
", onDuplicateKeyAssignments=" + onDuplicateKeyAssignments +
", constraintColumns=" + constraintColumns +
'}';
| 531 | 59 | 590 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/IntervalLiteral.java | IntervalLiteral | equals | class IntervalLiteral extends Literal {
public enum Sign {
PLUS,
MINUS
}
public enum IntervalField {
YEAR,
MONTH,
DAY,
HOUR,
MINUTE,
SECOND
}
private final String value;
private final Sign sign;
private final IntervalField st... |
if (this == obj) {
return true;
}
if (obj == null || getClass() != obj.getClass()) {
return false;
}
IntervalLiteral other = (IntervalLiteral) obj;
return Objects.equals(this.value, other.value) &&
Objects.equals(this.sign, other.si... | 522 | 128 | 650 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public static io.crate.sql.tree.Literal fromObject(java.lang.Object) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/IsNullPredicate.java | IsNullPredicate | equals | class IsNullPredicate extends Expression {
private final Expression value;
public IsNullPredicate(Expression value) {
this.value = requireNonNull(value, "value is null");
}
public Expression getValue() {
return value;
}
@Override
public <R, C> R accept(AstVisitor<R, C> vi... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
IsNullPredicate that = (IsNullPredicate) o;
return Objects.equals(value, that.value);
| 174 | 77 | 251 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public final java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/JoinOn.java | JoinOn | equals | class JoinOn extends JoinCriteria {
private final Expression expression;
public JoinOn(Expression expression) {
this.expression = requireNonNull(expression, "expression is null");
}
public Expression getExpression() {
return expression;
}
@Override
public boolean equals(O... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
JoinOn joinOn = (JoinOn) o;
return Objects.equals(expression, joinOn.expression);
| 160 | 75 | 235 | <methods>public non-sealed void <init>() ,public abstract boolean equals(java.lang.Object) ,public abstract int hashCode() ,public abstract java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/JoinUsing.java | JoinUsing | equals | class JoinUsing extends JoinCriteria {
private static QualifiedName extendQualifiedName(QualifiedName name, String ext) {
List<String> parts = new ArrayList<>(name.getParts().size() + 1);
parts.addAll(name.getParts());
parts.add(ext);
return new QualifiedName(parts);
}
publ... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
JoinUsing joinUsing = (JoinUsing) o;
return Objects.equals(columns, joinUsing.columns);
| 564 | 75 | 639 | <methods>public non-sealed void <init>() ,public abstract boolean equals(java.lang.Object) ,public abstract int hashCode() ,public abstract java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/Literal.java | Literal | fromObject | class Literal
extends Expression {
@Override
public <R, C> R accept(AstVisitor<R, C> visitor, C context) {
return visitor.visitLiteral(this, context);
}
public static Literal fromObject(Object value) {<FILL_FUNCTION_BODY>}
} |
Literal literal = null;
if (value == null) {
literal = NullLiteral.INSTANCE;
} else if (value instanceof Number n) {
if (value instanceof Float || value instanceof Double) {
literal = new DoubleLiteral(value.toString());
} else if (value insta... | 84 | 355 | 439 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public final java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/LongLiteral.java | LongLiteral | equals | class LongLiteral extends Literal {
private final long value;
public LongLiteral(long value) {
this.value = value;
}
public long getValue() {
return value;
}
@Override
public <R, C> R accept(AstVisitor<R, C> visitor, C context) {
return visitor.visitLongLiteral(th... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
LongLiteral that = (LongLiteral) o;
return value == that.value;
| 164 | 68 | 232 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public static io.crate.sql.tree.Literal fromObject(java.lang.Object) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/MatchPredicate.java | MatchPredicate | equals | class MatchPredicate extends Expression {
private final List<MatchPredicateColumnIdent> idents;
private final Expression value;
private final GenericProperties<Expression> properties;
private final String matchType;
public MatchPredicate(List<MatchPredicateColumnIdent> idents,
... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
MatchPredicate that = (MatchPredicate) o;
return Objects.equals(idents, that.idents) &&
Objects.equals(value, that.value) &&
... | 369 | 119 | 488 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public final java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/MultiStatement.java | MultiStatement | equals | class MultiStatement extends Statement {
private final List<Statement> statements;
public MultiStatement(List<Statement> statements) {
this.statements = statements;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + ... |
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
MultiStatement other = (MultiStatement) obj;
if (statements == null) {
if (other.state... | 186 | 133 | 319 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/NaturalJoin.java | NaturalJoin | equals | class NaturalJoin extends JoinCriteria {
@Override
public boolean equals(Object obj) {<FILL_FUNCTION_BODY>}
@Override
public int hashCode() {
return 0;
}
@Override
public String toString() {
return "NaturalJoin{}";
}
} |
if (this == obj) {
return true;
}
return (obj != null) && (getClass() == obj.getClass());
| 85 | 40 | 125 | <methods>public non-sealed void <init>() ,public abstract boolean equals(java.lang.Object) ,public abstract int hashCode() ,public abstract java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/NotExpression.java | NotExpression | equals | class NotExpression extends Expression {
private final Expression value;
public NotExpression(Expression value) {
this.value = requireNonNull(value, "value is null");
}
public Expression getValue() {
return value;
}
@Override
public boolean equals(Object o) {<FILL_FUNCTIO... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
NotExpression that = (NotExpression) o;
return Objects.equals(value, that.value);
| 168 | 73 | 241 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public final java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/NullLiteral.java | NullLiteral | equals | class NullLiteral extends Literal {
public static final NullLiteral INSTANCE = new NullLiteral();
private NullLiteral() {
}
@Override
public <R, C> R accept(AstVisitor<R, C> visitor, C context) {
return visitor.visitNullLiteral(this, context);
}
@Override
public boolean equals... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
return true;
| 132 | 53 | 185 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public static io.crate.sql.tree.Literal fromObject(java.lang.Object) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/ObjectLiteral.java | ObjectLiteral | equals | class ObjectLiteral extends Literal {
private final Map<String, Expression> values;
public ObjectLiteral(Map<String, Expression> values) {
this.values = values;
}
public Map<String, Expression> values() {
return values;
}
@Override
public <R, C> R accept(AstVisitor<R, C> ... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ObjectLiteral that = (ObjectLiteral) o;
if (!values.equals(that.values)) return false;
return true;
| 172 | 70 | 242 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public static io.crate.sql.tree.Literal fromObject(java.lang.Object) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/OptimizeStatement.java | OptimizeStatement | equals | class OptimizeStatement<T> extends Statement {
private final List<Table<T>> tables;
private final GenericProperties<T> properties;
public OptimizeStatement(List<Table<T>> tables, GenericProperties<T> properties) {
this.tables = tables;
this.properties = properties;
}
public List<T... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
OptimizeStatement<?> that = (OptimizeStatement<?>) o;
return Objects.equals(tables, that.tables) &&
Objects.equals(properties, that.prope... | 350 | 96 | 446 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/ParameterExpression.java | ParameterExpression | equals | class ParameterExpression extends Expression {
private final int position;
public ParameterExpression(int position) {
this.position = position;
}
@Override
public <R, C> R accept(AstVisitor<R, C> visitor, C context) {
return visitor.visitParameterExpression(this, context);
}
... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ParameterExpression that = (ParameterExpression) o;
if (position != that.position) return false;
return true;
| 172 | 70 | 242 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public final java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/PrivilegeStatement.java | PrivilegeStatement | equals | class PrivilegeStatement extends Statement
permits GrantPrivilege, RevokePrivilege, DenyPrivilege {
protected final List<String> userNames;
protected final List<String> permissions;
private final List<QualifiedName> tableOrSchemaNames;
private final String securable;
protected final boolean all... |
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
PrivilegeStatement that = (PrivilegeStatement) o;
return all == that.all &&
Objects.equals(userNames, that.userNames) &&
Objects.equals(permissions, that.permissions);
... | 438 | 93 | 531 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/QueryUtil.java | QueryUtil | selectList | class QueryUtil {
public static Select selectList(Expression... expressions) {<FILL_FUNCTION_BODY>}
public static List<Relation> table(QualifiedName name) {
return List.of(new Table<>(name));
}
} |
ArrayList<SelectItem> items = new ArrayList<>();
for (Expression expression : expressions) {
items.add(new SingleColumn(expression));
}
return new Select(false, items);
| 68 | 51 | 119 | <no_super_class> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/RerouteCancelShard.java | RerouteCancelShard | equals | class RerouteCancelShard<T> extends RerouteOption {
private final T shardId;
private final T nodeIdOrName;
private final GenericProperties<T> properties;
public RerouteCancelShard(T shardId, T nodeIdOrName, GenericProperties<T> properties) {
this.shardId = shardId;
this.nodeIdOrName = ... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
RerouteCancelShard<?> that = (RerouteCancelShard<?>) o;
return Objects.equals(nodeIdOrName, that.nodeIdOrName) &&
Objects.equals(shardId,... | 444 | 125 | 569 | <methods>public non-sealed void <init>() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/RerouteMoveShard.java | RerouteMoveShard | equals | class RerouteMoveShard<T> extends RerouteOption {
private final T shardId;
private final T fromNodeIdOrName;
private final T toNodeIdOrName;
public RerouteMoveShard(T shardId, T fromNodeIdOrName, T toNodeIdOrName) {
this.shardId = shardId;
this.fromNodeIdOrName = fromNodeIdOrName;
... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
RerouteMoveShard<?> that = (RerouteMoveShard<?>) o;
return Objects.equals(shardId, that.shardId) &&
Objects.equals(fromNodeIdOrName, that... | 475 | 135 | 610 | <methods>public non-sealed void <init>() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/Select.java | Select | equals | class Select extends Node {
private final boolean distinct;
private final List<SelectItem> selectItems;
public Select(boolean distinct, List<SelectItem> selectItems) {
this.distinct = distinct;
this.selectItems = Collections.unmodifiableList(selectItems);
}
public boolean isDistin... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
Select select = (Select) o;
return distinct == select.distinct &&
Objects.equals(selectItems, select.selectItems);
| 269 | 82 | 351 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) ,public abstract boolean equals(java.lang.Object) ,public abstract int hashCode() ,public abstract java.lang.String toString() <variables> |
crate_crate | crate/libs/sql-parser/src/main/java/io/crate/sql/tree/SetSessionAuthorizationStatement.java | SetSessionAuthorizationStatement | equals | class SetSessionAuthorizationStatement extends Statement {
public enum Scope {
SESSION, LOCAL
}
@Nullable
private final String user;
private final Scope scope;
public SetSessionAuthorizationStatement(Scope scope) {
this(null, scope);
}
public SetSessionAuthorizationSt... |
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
SetSessionAuthorizationStatement that = (SetSessionAuthorizationStatement) o;
return Objects.equals(user, that.user) &&
scope == that.sco... | 367 | 88 | 455 | <methods>public non-sealed void <init>() ,public R accept(AstVisitor<R,C>, C) <variables> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.