name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
flink_Types_ROW_NAMED | /**
* Returns type information for {@link org.apache.flink.types.Row} with fields of the given
* types and with given names. A row must not be null.
*
* <p>A row is a fixed-length, null-aware composite type for storing multiple values in a
* deterministic field order. Every field can be null independent of the fie... | 3.68 |
shardingsphere-elasticjob_TracingStorageConverterFactory_findConverter | /**
* Find {@link TracingStorageConfigurationConverter} for specific storage type.
*
* @param storageType storage type
* @param <T> storage type
* @return instance of {@link TracingStorageConfigurationConverter}
*/
@SuppressWarnings("unchecked")
public static <T> Optional<TracingStorageConfigurationConverter<T>> ... | 3.68 |
framework_VDateField_setCurrentResolution | /**
* Sets the resolution.
*
* @param currentResolution
* the new resolution
*/
public void setCurrentResolution(R currentResolution) {
this.currentResolution = currentResolution;
} | 3.68 |
hadoop_TypedBytesOutput_writeListHeader | /**
* Writes a list header.
*
* @throws IOException
*/
public void writeListHeader() throws IOException {
out.write(Type.LIST.code);
} | 3.68 |
hudi_HoodieBaseFileGroupRecordBuffer_merge | /**
* Merge two records using the configured record merger.
*
* @param older
* @param olderInfoMap
* @param newer
* @param newerInfoMap
* @return
* @throws IOException
*/
protected Option<T> merge(Option<T> older, Map<String, Object> olderInfoMap,
Option<T> newer, Map<String, Object> ne... | 3.68 |
querydsl_GeometryExpression_intersection | /**
* Returns a geometric object that represents the Point set intersection of this geometric
* object with anotherGeometry.
*
* @param geometry other geometry
* @return intersection of this and the other geometry
*/
public GeometryExpression<Geometry> intersection(Expression<? extends Geometry> geometry) {
r... | 3.68 |
flink_RawType_restore | /** Restores a raw type from the components of a serialized string representation. */
@SuppressWarnings({"unchecked", "rawtypes"})
public static RawType<?> restore(
ClassLoader classLoader, String className, String serializerString) {
try {
final Class<?> clazz = Class.forName(className, true, class... | 3.68 |
framework_Table_getColumnHeader | /**
* Gets the header for the specified column.
*
* @param propertyId
* the propertyId identifying the column.
* @return the header for the specified column if it has one.
*/
public String getColumnHeader(Object propertyId) {
if (getColumnHeaderMode() == ColumnHeaderMode.HIDDEN) {
return nu... | 3.68 |
hbase_SplitWALManager_addUsedSplitWALWorker | /**
* When master restart, there will be a new splitWorkerAssigner. But if there are splitting WAL
* tasks running on the region server side, they will not be count by the new splitWorkerAssigner.
* Thus we should add the workers of running tasks to the assigner when we load the procedures
* from MasterProcWALs.
*... | 3.68 |
hibernate-validator_ConstraintCheckIssue_isWarning | /**
* Determine if issue is a warning
*
* @return true if {@link ConstraintCheckIssue#getKind()} equals to {@link IssueKind#WARNING}
*/
public boolean isWarning() {
return IssueKind.WARNING.equals( kind );
} | 3.68 |
morf_H2_matchesProduct | /**
* @see org.alfasoftware.morf.jdbc.DatabaseType#matchesProduct(java.lang.String)
*/
@Override
public boolean matchesProduct(String product) {
return product.equalsIgnoreCase("H2");
} | 3.68 |
flink_CheckpointConfig_setMaxConcurrentCheckpoints | /**
* Sets the maximum number of checkpoint attempts that may be in progress at the same time. If
* this value is <i>n</i>, then no checkpoints will be triggered while <i>n</i> checkpoint
* attempts are currently in flight. For the next checkpoint to be triggered, one checkpoint
* attempt would need to finish or ex... | 3.68 |
flink_Dispatcher_createDirtyJobResultEntryAsync | /**
* Creates a dirty entry in the {@link #jobResultStore} based on the passed {@code
* hasDirtyJobResultEntry} flag.
*
* @param executionGraph The {@link AccessExecutionGraph} that is used to generate the entry.
* @param hasDirtyJobResultEntry The decision the entry creation is based on.
* @return {@code Complet... | 3.68 |
dubbo_CtClassBuilder_build | /**
* build CtClass object
*/
public CtClass build(ClassLoader classLoader) throws NotFoundException, CannotCompileException {
ClassPool pool = new ClassPool(true);
pool.insertClassPath(new LoaderClassPath(classLoader));
pool.insertClassPath(new DubboLoaderClassPath());
// create class
CtClass ct... | 3.68 |
morf_HumanReadableStatementHelper_generateListCriterionString | /**
* Generates a string describing a criterion made up of a list of sub-criteria and a joining
* operator, for example the OR or AND operators.
*
* @param criterion the criterion with a list of sub-criteria to be composed.
* @param join the joining operator, including spaces, for example " or ".
* @param invert ... | 3.68 |
framework_GridElement_getHeaderCell | /**
* Gets header cell element with given row and column index.
*
* @param rowIndex
* Row index
* @param colIndex
* Column index
* @return Header cell element with given indices.
*/
public GridCellElement getHeaderCell(int rowIndex, int colIndex) {
return getSubPart("#header[" + rowInd... | 3.68 |
framework_ContainerOrderedWrapper_nextItemId | /*
* Gets the item that is next from the specified item. Don't add a JavaDoc
* comment here, we use the default documentation from implemented
* interface.
*/
@Override
public Object nextItemId(Object itemId) {
if (ordered) {
return ((Container.Ordered) container).nextItemId(itemId);
}
if (itemI... | 3.68 |
hbase_HFileLink_createBackReferenceName | /**
* Create the back reference name
*/
// package-private for testing
static String createBackReferenceName(final String tableNameStr, final String regionName) {
return regionName + "." + tableNameStr.replace(TableName.NAMESPACE_DELIM, '=');
} | 3.68 |
morf_SchemaValidator_checkForValidationErrors | /**
* Check whether any errors have been added
*/
private void checkForValidationErrors() {
// check for errors
if (!validationFailures.isEmpty()) {
StringBuilder message = new StringBuilder("Schema validation failures:");
for (String failure : validationFailures) {
message.append("\n");
messa... | 3.68 |
morf_AbstractSqlDialectTest_testInsertFromSelectWithSomeDefaults | /**
* Tests that an insert from a select works when some of the defaults are supplied
*/
@Test
public void testInsertFromSelectWithSomeDefaults() {
InsertStatement stmt = new InsertStatement().into(new TableReference(TEST_TABLE)).from(new TableReference(OTHER_TABLE)).withDefaults(new FieldLiteral(20010101).as(DATE_... | 3.68 |
hadoop_AbstractSchedulerPlanFollower_calculateReservationToPlanProportion | /**
* Resizes reservations based on currently available resources.
*/
private Resource calculateReservationToPlanProportion(
ResourceCalculator rescCalculator, Resource availablePlanResources,
Resource totalReservationResources, Resource reservationResources) {
return Resources.multiply(availablePlanResourc... | 3.68 |
framework_VFilterSelect_createTextBox | /**
* This method will create the TextBox used by the VFilterSelect instance.
* It is invoked during the Constructor and should only be overridden if a
* custom TextBox shall be used. The overriding method cannot use any
* instance variables.
*
* @since 7.1.5
* @return TextBox instance used by this VFilterSelect... | 3.68 |
framework_VScrollTable_enableBrowserIntelligence | /**
* Enable browser measurement of the table width.
*/
public void enableBrowserIntelligence() {
hTableContainer.getStyle().clearWidth();
} | 3.68 |
framework_HierarchyRenderer_isElementInHierarchyWidget | /**
* Decides whether the element was rendered by {@link HierarchyRenderer}.
*
* @param element
* the element to check
* @return {@code true} if the element was rendered by a HierarchyRenderer,
* {@code false} otherwise.
*/
public static boolean isElementInHierarchyWidget(Element element) {
... | 3.68 |
framework_FocusableFlexTable_addKeyDownHandler | /*
* (non-Javadoc)
*
* @see
* com.google.gwt.event.dom.client.HasKeyDownHandlers#addKeyDownHandler(
* com.google.gwt.event.dom.client.KeyDownHandler)
*/
@Override
public HandlerRegistration addKeyDownHandler(KeyDownHandler handler) {
return addDomHandler(handler, KeyDownEvent.getType());
} | 3.68 |
flink_HsMemoryDataManager_getBuffersInOrder | // Write lock should be acquired before invoke this method.
@Override
public Deque<BufferIndexAndChannel> getBuffersInOrder(
int subpartitionId, SpillStatus spillStatus, ConsumeStatusWithId consumeStatusWithId) {
HsSubpartitionMemoryDataManager targetSubpartitionDataManager =
getSubpartitionMemo... | 3.68 |
pulsar_Reflections_classInJarImplementsIface | /**
* check if a class implements an interface.
*
* @param fqcn fully qualified class name to search for in jar
* @param xface interface to check if implement
* @return true if class from jar implements interface xface and false if otherwise
*/
public static boolean classInJarImplementsIface(java.io.File jar, Str... | 3.68 |
hudi_SparkDataSourceContinuousIngestTool_readConfigFromFileSystem | /**
* Reads config from the file system.
*
* @param jsc {@link JavaSparkContext} instance.
* @param cfg {@link HoodieRepairTool.Config} instance.
* @return the {@link TypedProperties} instance.
*/
private TypedProperties readConfigFromFileSystem(JavaSparkContext jsc, Config cfg) {
return UtilHelpers.readConfig(... | 3.68 |
flink_ExistingSavepoint_readBroadcastState | /**
* Read operator {@code BroadcastState} from a {@code Savepoint} when a custom serializer was
* used; e.g., a different serializer than the one returned by {@code
* TypeInformation#createSerializer}.
*
* @param uid The uid of the operator.
* @param name The (unique) name for the state.
* @param keyTypeInfo Th... | 3.68 |
hudi_CollectionUtils_copy | /**
* Makes a copy of provided {@link Properties} object
*/
public static Properties copy(Properties props) {
Properties copy = new Properties();
copy.putAll(props);
return copy;
} | 3.68 |
flink_OggJsonFormatFactory_validateDecodingFormatOptions | /** Validator for ogg decoding format. */
private static void validateDecodingFormatOptions(ReadableConfig tableOptions) {
JsonFormatOptionsUtil.validateDecodingFormatOptions(tableOptions);
} | 3.68 |
hbase_WALProcedureStore_getWALDir | // ==========================================================================
// FileSystem Log Files helpers
// ==========================================================================
public Path getWALDir() {
return this.walDir;
} | 3.68 |
flink_ArrowUtils_toArrowSchema | /** Returns the Arrow schema of the specified type. */
public static Schema toArrowSchema(RowType rowType) {
Collection<Field> fields =
rowType.getFields().stream()
.map(f -> ArrowUtils.toArrowField(f.getName(), f.getType()))
.collect(Collectors.toCollection(Array... | 3.68 |
morf_DatabaseMetaDataProvider_viewExists | /**
* @see org.alfasoftware.morf.metadata.Schema#viewExists(java.lang.String)
*/
@Override
public boolean viewExists(String viewName) {
return viewNames.get().containsKey(named(viewName));
} | 3.68 |
hadoop_DelegatingSSLSocketFactory_bindToOpenSSLProvider | /**
* Bind to the OpenSSL provider via wildfly.
* This MUST be the only place where wildfly classes are referenced,
* so ensuring that any linkage problems only surface here where they may
* be caught by the initialization code.
*/
private void bindToOpenSSLProvider()
throws NoSuchAlgorithmException, KeyManage... | 3.68 |
flink_KubernetesStateHandleStore_replace | /**
* Replaces a state handle in ConfigMap and discards the old state handle. Wo do not lock
* resource version and then replace in Kubernetes. Since the ConfigMap is periodically updated
* by leader, the resource version changes very fast. We use a "check-existence and update"
* transactional operation instead.
*... | 3.68 |
flink_UpsertTestFileUtil_readRecords | /**
* Reads records that were written using the {@link UpsertTestSinkWriter} from the given
* InputStream.
*
* @param bis The BufferedInputStream to read from
* @return Map containing the read ImmutableByteArrayWrapper key-value pairs
* @throws IOException
*/
private static Map<ImmutableByteArrayWrapper, Immutab... | 3.68 |
framework_WindowMoveListener_setup | /*
* (non-Javadoc)
*
* @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server.
* VaadinRequest)
*/
@Override
protected void setup(VaadinRequest request) {
Window w = new Window("Caption");
w.setId("testwindow");
w.setHeight("100px");
w.setWidth("100px");
w.setPositionX(100);
... | 3.68 |
flink_AbstractStreamOperator_snapshotState | /**
* Stream operators with state, which want to participate in a snapshot need to override this
* hook method.
*
* @param context context that provides information and means required for taking a snapshot
*/
@Override
public void snapshotState(StateSnapshotContext context) throws Exception {} | 3.68 |
hadoop_ResourceUsage_getUsed | /*
* Used
*/
public Resource getUsed() {
return getUsed(NL);
} | 3.68 |
graphhopper_CHStorage_toShortcutPointer | /**
* To use the shortcut getters/setters you need to convert shortcut IDs to an shortcutPointer first
*/
public long toShortcutPointer(int shortcut) {
assert shortcut < shortcutCount : "shortcut " + shortcut + " not in bounds [0, " + shortcutCount + "[";
return (long) shortcut * shortcutEntryBytes;
} | 3.68 |
framework_WebBrowser_isAndroid | /**
* Tests if the browser is run on Android.
*
* @return true if run on Android false if the user is not using Android or
* if no information on the browser is present
*/
public boolean isAndroid() {
return browserDetails.isAndroid();
} | 3.68 |
hadoop_QueueResourceQuotas_getEffectiveMaxResource | /*
* Effective Maximum Resource
*/
public Resource getEffectiveMaxResource() {
return getEffectiveMaxResource(NL);
} | 3.68 |
hbase_MultiTableInputFormatBase_createRecordReader | /**
* Builds a TableRecordReader. If no TableRecordReader was provided, uses the default.
* @param split The split to work with.
* @param context The current context.
* @return The newly created record reader.
* @throws IOException When creating the reader fails.
* @throws InterruptedException when rec... | 3.68 |
hadoop_DockerCommandExecutor_isStoppable | /**
* Is the container in a stoppable state?
*
* @param containerStatus the container's {@link DockerContainerStatus}.
* @return is the container in a stoppable state.
*/
public static boolean isStoppable(DockerContainerStatus containerStatus) {
if (containerStatus.equals(DockerContainerStatus... | 3.68 |
flink_CliFrontend_stop | /**
* Executes the STOP action.
*
* @param args Command line arguments for the stop action.
*/
protected void stop(String[] args) throws Exception {
LOG.info("Running 'stop-with-savepoint' command.");
final Options commandOptions = CliFrontendParser.getStopCommandOptions();
final CommandLine commandLin... | 3.68 |
flink_CheckpointConfig_isExternalizedCheckpointsEnabled | /**
* Returns whether checkpoints should be persisted externally.
*
* @return <code>true</code> if checkpoints should be externalized.
*/
@PublicEvolving
public boolean isExternalizedCheckpointsEnabled() {
return getExternalizedCheckpointCleanup()
!= ExternalizedCheckpointCleanup.NO_EXTERNALIZED_CHE... | 3.68 |
flink_WikipediaEditEvent_getTimestamp | /**
* Returns the timestamp when this event arrived at the source.
*
* @return The timestamp assigned at the source.
*/
public long getTimestamp() {
return timestamp;
} | 3.68 |
rocketmq-connect_ClusterConfigState_targetState | /**
* Get the target state of the connector
*
* @param connector
* @return
*/
public TargetState targetState(String connector) {
return connectorTargetStates.get(connector);
} | 3.68 |
pulsar_FieldParser_stringToSet | /**
* Converts comma separated string to Set.
*
* @param <T>
* type of set
* @param val
* comma separated values.
* @return The converted set with type {@code <T>}.
*/
public static <T> Set<T> stringToSet(String val, Class<T> type) {
if (val == null) {
return null;
}
St... | 3.68 |
flink_PojoSerializer_createRegisteredSubclassTags | /**
* Builds map of registered subclasses to their class tags. Class tags will be integers starting
* from 0, assigned incrementally with the order of provided subclasses.
*/
private static LinkedHashMap<Class<?>, Integer> createRegisteredSubclassTags(
LinkedHashSet<Class<?>> registeredSubclasses) {
fina... | 3.68 |
flink_JoinInputSideSpec_hasUniqueKey | /** Returns true if the input has unique key, otherwise false. */
public boolean hasUniqueKey() {
return inputSideHasUniqueKey;
} | 3.68 |
starts_ChecksumUtil_makeCheckSumMap | /**
* This method creates the checksum map only for tests that are affected by changes.
*
* @param loader The classloader from which to find .class files
* @param testDeps The transitive closure of dependencies for each test
* @param affected The set of tests that are affected by the changes
* @return The check... | 3.68 |
framework_MenuTooltip_setup | /*
* (non-Javadoc)
*
* @see com.vaadin.tests.components.AbstractTestUI#setup(com.vaadin.server.
* VaadinRequest)
*/
@Override
protected void setup(VaadinRequest request) {
addComponent(buildMenu());
getTooltipConfiguration().setOpenDelay(2000);
} | 3.68 |
framework_VColorPickerGradient_getCursorX | /**
* Returns the latest x-coordinate for pressed-down mouse cursor.
*
* @return the latest x-coordinate
*/
public int getCursorX() {
return cursorX;
} | 3.68 |
hadoop_HSAuditLogger_logSuccess | /**
* Create a readable and parseable audit log string for a successful event.
*
* @param user
* User who made the service request.
* @param operation
* Operation requested by the user.
* @param target
* The target on which the operation is being performed.
*
* <br>
* <br>
* ... | 3.68 |
framework_VDragEvent_getTransferable | /**
* Returns the VTransferable instance that represents the original dragged
* element.
*
* @return the transferable instance
*/
public VTransferable getTransferable() {
return transferable;
} | 3.68 |
hbase_UnsafeAccess_putShort | // APIs to add primitives to BBs
/**
* Put a short value out to the specified BB position in big-endian format.
* @param buf the byte buffer
* @param offset position in the buffer
* @param val short to write out
* @return incremented offset
*/
public static int putShort(ByteBuffer buf, int offset, short val... | 3.68 |
querydsl_ExpressionUtils_toExpression | /**
* Converts the given object to an Expression
*
* <p>Casts expressions and wraps everything else into co</p>
*
* @param o object to convert
* @return converted argument
*/
public static Expression<?> toExpression(Object o) {
if (o instanceof Expression) {
return (Expression<?>) o;
} else {
... | 3.68 |
hadoop_Exec_getOutput | /**
* Get every line consumed from the input.
*
* @return Every line consumed from the input
*/
public List<String> getOutput() {
return output;
} | 3.68 |
hadoop_AzureNativeFileSystemStore_getInstrumentedContext | /**
* Creates a new OperationContext for the Azure Storage operation that has
* listeners hooked to it that will update the metrics for this file system.
*
* @param bindConcurrentOOBIo
* - bind to intercept send request call backs to handle OOB I/O.
*
* @return The OperationContext object to use.
*/
pr... | 3.68 |
flink_HashPartition_getNumOccupiedMemorySegments | /**
* Gets the number of memory segments used by this partition, which includes build side memory
* buffers and overflow memory segments.
*
* @return The number of occupied memory segments.
*/
public int getNumOccupiedMemorySegments() {
// either the number of memory segments, or one for spilling
final int... | 3.68 |
flink_JoinOperator_projectTuple20 | /**
* Projects a pair of joined elements to a {@link Tuple} with the previously selected
* fields. Requires the classes of the fields of the resulting tuples.
*
* @return The projected data set.
* @see Tuple
* @see DataSet
*/
public <
T0,
T1,
T2,
T3... | 3.68 |
hudi_HoodieBackedTableMetadataWriter_getFileNameToSizeMap | // Returns a map of filenames mapped to their lengths
Map<String, Long> getFileNameToSizeMap() {
return filenameToSizeMap;
} | 3.68 |
pulsar_LoadSimulationController_handleStop | // Handle the command line arguments associated with the stop command.
private void handleStop(final ShellArguments arguments) throws Exception {
final List<String> commandArguments = arguments.commandArguments;
// Stop expects three application arguments: tenant name, namespace
// name, and topic name.
... | 3.68 |
flink_ZooKeeperStateHandleStore_release | /**
* Releases the lock from the node under the given ZooKeeper path. If no lock exists, then
* nothing happens.
*
* @param pathInZooKeeper Path describing the ZooKeeper node
* @throws Exception if the delete operation of the lock node fails
*/
@Override
public void release(String pathInZooKeeper) throws Exceptio... | 3.68 |
hbase_DefaultMemStore_main | /**
* Code to help figure if our approximation of object heap sizes is close enough. See hbase-900.
* Fills memstores then waits so user can heap dump and bring up resultant hprof in something like
* jprofiler which allows you get 'deep size' on objects.
* @param args main args
*/
public static void main(String[] ... | 3.68 |
hbase_RegionCoprocessorHost_preMemStoreCompactionCompact | /**
* Invoked before compacting memstore.
*/
public InternalScanner preMemStoreCompactionCompact(HStore store, InternalScanner scanner)
throws IOException {
if (coprocEnvironments.isEmpty()) {
return scanner;
}
return execOperationWithResult(new ObserverOperationWithResult<RegionObserver, InternalScanner>... | 3.68 |
hadoop_SnappyDecompressor_needsInput | /**
* Returns true if the input data buffer is empty and
* {@link #setInput(byte[], int, int)} should be called to
* provide more input.
*
* @return <code>true</code> if the input data buffer is empty and
* {@link #setInput(byte[], int, int)} should be called in
* order to provide more input.
*/... | 3.68 |
framework_DragStartEvent_getComponent | /**
* Returns the drag source component where the dragstart event occurred.
*
* @return Component which is dragged.
*/
@Override
@SuppressWarnings("unchecked")
public T getComponent() {
return (T) super.getComponent();
} | 3.68 |
dubbo_CollectionUtils_ofSet | /**
* Convert to multiple values to be {@link LinkedHashSet}
*
* @param values one or more values
* @param <T> the type of <code>values</code>
* @return read-only {@link Set}
*/
public static <T> Set<T> ofSet(T... values) {
int size = values == null ? 0 : values.length;
if (size < 1) {
return e... | 3.68 |
framework_TouchScrollDelegate_enableTouchScrolling | /**
* Makes the given elements scrollable, either natively or by using a
* TouchScrollDelegate, depending on platform capabilities.
*
* @param widget
* The widget that contains scrollable elements
* @param scrollables
* The elements inside the widget that should be scrollable
* @return A s... | 3.68 |
flink_TimestampData_getMillisecond | /** Returns the number of milliseconds since {@code 1970-01-01 00:00:00}. */
public long getMillisecond() {
return millisecond;
} | 3.68 |
framework_CommErrorEmulatorUI_setup | // Server exceptions will occur in this test as we are writing the response
// here and not letting the servlet write it
@Override
protected void setup(VaadinRequest request) {
String transport = request.getParameter("transport");
if ("websocket".equalsIgnoreCase(transport)) {
log("Using websocket");
... | 3.68 |
flink_TestSignalHandler_handle | /**
* Handle an incoming signal.
*
* @param signal The incoming signal
*/
@Override
public void handle(Signal signal) {
LOG.warn(
"RECEIVED SIGNAL {}: SIG{}. Shutting down as requested.",
signal.getNumber(),
signal.getName());
prevHandler.handle(signal);
} | 3.68 |
flink_CompositeType_hasField | /** Returns true when this type has a composite field with the given name. */
@PublicEvolving
public boolean hasField(String fieldName) {
return getFieldIndex(fieldName) >= 0;
} | 3.68 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.