name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
AreaShop_GeneralRegion_runCommands | /**
* Run commands as the CommandsSender, replacing all tags with the relevant values.
* @param sender The sender that should perform the command
* @param commands A list of the commands to run (without slash and with tags)
*/
public void runCommands(CommandSender sender, List<String> commands) {
if(commands == ... | 3.68 |
hmily_XaResourcePool_removeResource | /**
* Remove resource xa resource wrapped.
*
* @param xid the xid
* @return the xa resource wrapped
*/
public XaResourceWrapped removeResource(final Xid xid) {
String gid = new String(xid.getGlobalTransactionId());
if (xids.containsKey(gid)) {
xids.get(gid).remove(xid);
}
return pool.remove... | 3.68 |
hbase_HRegionFileSystem_getStoreHomedir | /**
* @param tabledir {@link Path} to where the table is being stored
* @param encodedName Encoded region name.
* @param family {@link ColumnFamilyDescriptor} describing the column family
* @return Path to family/Store home directory.
*/
public static Path getStoreHomedir(final Path tabledir, final String ... | 3.68 |
framework_VLoadingIndicator_setConnection | /**
* Sets the {@link ApplicationConnection} which uses this loading indicator.
* Only used internally.
*
* @param connection
* The ApplicationConnection for this loading indicator
*/
void setConnection(ApplicationConnection connection) {
this.connection = connection;
} | 3.68 |
framework_GridElement_getHeader | /**
* Get the header element.
*
* @return The thead element
*/
public TestBenchElement getHeader() {
return getSubPart("#header");
} | 3.68 |
hbase_PrivateCellUtil_writeCell | /**
* Writes the cell to the given OutputStream
* @param cell the cell to be written
* @param out the outputstream
* @param withTags if tags are to be written or not
* @return the total bytes written
*/
public static int writeCell(Cell cell, OutputStream out, boolean withTags) throws IOException {
if (... | 3.68 |
hbase_StoreFileWriter_getHFileWriter | /**
* For use in testing.
*/
HFile.Writer getHFileWriter() {
return writer;
} | 3.68 |
hbase_SyncFuture_reset | /**
* Call this method to clear old usage and get it ready for new deploy.
* @param txid the new transaction id
*/
SyncFuture reset(long txid, boolean forceSync) {
if (t != null && t != Thread.currentThread()) {
throw new IllegalStateException();
}
t = Thread.currentThread();
if (!isDone()) {
throw n... | 3.68 |
querydsl_JTSMultiSurfaceExpression_centroid | /**
* The mathematical centroid for this MultiSurface. The result is not guaranteed to be on
* this MultiSurface.
*
* @return centroid
*/
public JTSPointExpression<Point> centroid() {
if (centroid == null) {
centroid = JTSGeometryExpressions.pointOperation(SpatialOps.CENTROID, mixin);
}
return ... | 3.68 |
flink_FileLock_normalizeFileName | /**
* Normalize the file name, which only allows slash, backslash, digits and letters.
*
* @param fileName Original file name
* @return File name with illegal characters stripped
*/
private static String normalizeFileName(String fileName) {
return fileName.replaceAll("[^\\w/\\\\]", "");
} | 3.68 |
hbase_RpcThrottleStorage_switchRpcThrottle | /**
* Store the rpc throttle value.
* @param enable Set to <code>true</code> to enable, <code>false</code> to disable.
* @throws IOException if an unexpected io exception occurs
*/
public void switchRpcThrottle(boolean enable) throws IOException {
try {
byte[] upData = Bytes.toBytes(enable);
ZKUtil.create... | 3.68 |
Activiti_IntegerToLong_primTransform | /**
* {@inheritDoc}
*/
@Override
protected Object primTransform(Object anObject) throws Exception {
return Long.valueOf((Integer) anObject);
} | 3.68 |
shardingsphere-elasticjob_ResponseBodySerializerFactory_getResponseBodySerializer | /**
* Get serializer for specific HTTP content type.
*
* <p>
* This method will look for a serializer instance of specific MIME type.
* If serializer not found, this method would look for serializer factory by MIME type.
* If it is still not found, the MIME type would be marked as <code>MISSING_SERIALIZER</code>.... | 3.68 |
hmily_OrderServiceImpl_mockInventoryWithTryTimeout | /**
* 模拟在订单支付操作中,库存在try阶段中的timeout
*
* @param count 购买数量
* @param amount 支付金额
* @return string
*/
@Override
public String mockInventoryWithTryTimeout(Integer count, BigDecimal amount) {
Order order = saveOrder(count, amount);
return paymentService.mockPaymentInventoryWithTryTimeout(order);
} | 3.68 |
zxing_BitMatrix_getEnclosingRectangle | /**
* This is useful in detecting the enclosing rectangle of a 'pure' barcode.
*
* @return {@code left,top,width,height} enclosing rectangle of all 1 bits, or null if it is all white
*/
public int[] getEnclosingRectangle() {
int left = width;
int top = height;
int right = -1;
int bottom = -1;
for (int y ... | 3.68 |
flink_DataStream_partitionCustom | // private helper method for custom partitioning
private <K> DataStream<T> partitionCustom(Partitioner<K> partitioner, Keys<T> keys) {
KeySelector<T, K> keySelector =
KeySelectorUtil.getSelectorForOneKey(
keys, partitioner, getType(), getExecutionConfig());
return setConnectionT... | 3.68 |
hbase_ZKAuthentication_loginServer | /**
* Log in the current zookeeper server process using the given configuration keys for the
* credential file and login principal.
* <p>
* <strong>This is only applicable when running on secure hbase</strong> On regular HBase (without
* security features), this will safely be ignored.
* </p>
* @param conf ... | 3.68 |
pulsar_TlsHostnameVerifier_normaliseAddress | /*
* Normalize IPv6 or DNS name.
*/
static String normaliseAddress(final String hostname) {
if (hostname == null) {
return hostname;
}
try {
final InetAddress inetAddress = InetAddress.getByName(hostname);
return inetAddress.getHostAddress();
} catch (final UnknownHostException... | 3.68 |
hbase_MetricsConnection_getConnectionCount | /** Return the connection count of the metrics within a scope */
public long getConnectionCount() {
return connectionCount.getCount();
} | 3.68 |
framework_VTooltip_setMaxWidth | /**
* Sets the maximum width of the tooltip popup.
*
* @param maxWidth
* The maximum width the tooltip popup (in pixels)
*/
public void setMaxWidth(int maxWidth) {
this.maxWidth = maxWidth;
} | 3.68 |
hbase_WAL_sync | /**
* @param txid Transaction id to sync to.
* @param forceSync Flag to force sync rather than flushing to the buffer. Example - Hadoop hflush
* vs hsync.
* @throws when timeout, it would throw {@link WALSyncTimeoutIOException}.
*/
default void sync(long txid, boolean forceSync) throws IOExce... | 3.68 |
hadoop_TaskAttemptContainerLaunchedEvent_getShufflePort | /**
* Get the port that the shuffle handler is listening on. This is only
* valid if the type of the event is TA_CONTAINER_LAUNCHED
* @return the port the shuffle handler is listening on.
*/
public int getShufflePort() {
return shufflePort;
} | 3.68 |
hbase_QuotaState_getGlobalLimiterWithoutUpdatingLastQuery | /**
* Return the limiter associated with this quota without updating internal last query stats
* @return the quota limiter
*/
synchronized QuotaLimiter getGlobalLimiterWithoutUpdatingLastQuery() {
return globalLimiter;
} | 3.68 |
streampipes_ParserDescriptionBuilder_create | /**
* Creates a new format description using the builder pattern.
*
* @param id A unique identifier of the new element, e.g., com.mycompany.sink.mynewdatasink
* @param label A human-readable name of the element.
* Will later be shown as the element name in the StreamPipes UI.
* @... | 3.68 |
hbase_ClientMetaTableAccessor_getTableHRegionLocations | /**
* Used to get all region locations for the specific table
* @param metaTable scanner over meta table
* @param tableName table we're looking for, can be null for getting all regions
* @return the list of region locations. The return value will be wrapped by a
* {@link CompletableFuture}.
*/
public stat... | 3.68 |
flink_TypeInferenceExtractor_forProcedure | /** Extracts a type in inference from a {@link Procedure}. */
public static TypeInference forProcedure(
DataTypeFactory typeFactory, Class<? extends Procedure> procedure) {
final ProcedureMappingExtractor mappingExtractor =
new ProcedureMappingExtractor(
typeFactory,
... | 3.68 |
hadoop_CsiGrpcClient_createControllerBlockingStub | /**
* Creates a blocking stub for CSI controller plugin on the given channel.
* @return the blocking stub
*/
public ControllerGrpc.ControllerBlockingStub createControllerBlockingStub(){
return ControllerGrpc.newBlockingStub(channel);
} | 3.68 |
querydsl_JTSGeometryExpressions_setSRID | /**
* Sets the SRID on a geometry to a particular integer value.
*
* @param expr geometry
* @param srid SRID
* @param <T>
* @return geometry
*/
public static <T extends Geometry> JTSGeometryExpression<T> setSRID(Expression<T> expr, int srid) {
return geometryOperation(expr.getType(), SpatialOps.SET_SRID,
... | 3.68 |
flink_ResourceManager_registerTaskExecutorInternal | /**
* Registers a new TaskExecutor.
*
* @param taskExecutorRegistration task executor registration parameters
* @return RegistrationResponse
*/
private RegistrationResponse registerTaskExecutorInternal(
TaskExecutorGateway taskExecutorGateway,
TaskExecutorRegistration taskExecutorRegistration) {
... | 3.68 |
hadoop_NativeTaskOutputFiles_getInputFileForWrite | /**
* Create a local reduce input file name.
*
* @param mapId a map task id
* @param size the size of the file
*/
public Path getInputFileForWrite(TaskID mapId, long size, Configuration conf)
throws IOException {
return lDirAlloc.getLocalPathForWrite(
String.format(REDUCE_INPUT_FILE_FORMAT_STRING, TASKT... | 3.68 |
flink_ZooKeeperLeaderElectionHaServices_tryDeleteEmptyParentZNodes | /**
* Tries to delete empty parent znodes.
*
* <p>IMPORTANT: This method can be removed once all supported ZooKeeper versions support the
* container {@link org.apache.zookeeper.CreateMode}.
*
* @throws Exception if the deletion fails for other reason than {@link
* KeeperException.NotEmptyException}
*/
priv... | 3.68 |
hbase_BoundedRecoveredEditsOutputSink_writeRemainingEntryBuffers | /**
* Write out the remaining RegionEntryBuffers and close the writers.
* @return true when there is no error.
*/
private boolean writeRemainingEntryBuffers() throws IOException {
for (EntryBuffers.RegionEntryBuffer buffer : entryBuffers.buffers.values()) {
closeCompletionService.submit(() -> {
append(bu... | 3.68 |
flink_AfterMatchSkipStrategy_skipPastLastEvent | /**
* Discards every partial match that started before emitted match ended.
*
* @return the created AfterMatchSkipStrategy
*/
public static SkipPastLastStrategy skipPastLastEvent() {
return SkipPastLastStrategy.INSTANCE;
} | 3.68 |
flink_StreamExecutionEnvironment_fromElements | /**
* Creates a new data stream that contains the given elements. The framework will determine the
* type according to the based type user supplied. The elements should be the same or be the
* subclass to the based type. The sequence of elements must not be empty. Note that this
* operation will result in a non-par... | 3.68 |
morf_SchemaChangeSequence_executeStatement | /**
* @see org.alfasoftware.morf.upgrade.DataEditor#executeStatement(org.alfasoftware.morf.sql.Statement)
*/
@Override
public void executeStatement(Statement statement) {
visitor.visit(new ExecuteStatement(statement));
statement.accept(schemaAndDataChangeVisitor);
} | 3.68 |
hbase_ProcedureStore_postSync | /**
* triggered when the store sync is completed.
*/
default void postSync() {
} | 3.68 |
morf_AliasedField_multiplyBy | /**
* @param expression value to multiply this field by.
* @return A new expression using {@link MathsField} and {@link MathsOperator#MULTIPLY}.
*/
public final MathsField multiplyBy(AliasedField expression) {
return new MathsField(this, MathsOperator.MULTIPLY, potentiallyBracketExpression(expression));
} | 3.68 |
framework_VScrollTable_emphasis | /**
* TODO needs different drop modes ?? (on cells, on rows), now only
* supports rows
*/
private void emphasis(TableDDDetails details) {
deEmphasis();
UIObject.setStyleName(getElement(), getStylePrimaryName() + "-drag",
true);
// iterate old and new emphasized row
for (Widget w : scrollB... | 3.68 |
morf_CompositeSchema_viewExists | /**
* @see org.alfasoftware.morf.metadata.Schema#viewExists(java.lang.String)
*/
@Override
public boolean viewExists(String name) {
for (Schema schema : delegates)
if (schema.viewExists(name))
return true;
return false;
} | 3.68 |
hbase_ZKWatcher_keeperException | /**
* Handles KeeperExceptions in client calls.
* <p>
* This may be temporary but for now this gives one place to deal with these.
* <p>
* TODO: Currently this method rethrows the exception to let the caller handle
* <p>
* @param ke the exception to rethrow
* @throws KeeperException if a ZooKeeper operation fai... | 3.68 |
hbase_SimpleServerRpcConnection_readAndProcess | /**
* Read off the wire. If there is not enough data to read, update the connection state with what
* we have and returns.
* @return Returns -1 if failure (and caller will close connection), else zero or more.
*/
public int readAndProcess() throws IOException, InterruptedException {
// If we have not read the con... | 3.68 |
flink_Tuple9_toString | /**
* Creates a string representation of the tuple in the form (f0, f1, f2, f3, f4, f5, f6, f7,
* f8), where the individual fields are the value returned by calling {@link Object#toString} on
* that field.
*
* @return The string representation of the tuple.
*/
@Override
public String toString() {
return "("
... | 3.68 |
dubbo_DubboBootstrap_isStopped | /**
* @return true if the dubbo application is stopping.
* @see #isStopped()
*/
public boolean isStopped() {
return applicationDeployer.isStopped();
} | 3.68 |
hadoop_FederationStateStoreFacade_getPoliciesConfigurations | /**
* Get the policies that is represented as
* {@link SubClusterPolicyConfiguration} for all currently active queues in
* the system.
*
* @return the policies for all currently active queues in the system
* @throws YarnException if the call to the state store is unsuccessful
*/
public Map<String, SubClusterPoli... | 3.68 |
hadoop_OpportunisticContainerContext_matchAllocationToOutstandingRequest | /**
* This method matches a returned list of Container Allocations to any
* outstanding OPPORTUNISTIC ResourceRequest.
* @param capability Capability
* @param allocations Allocations.
*/
public void matchAllocationToOutstandingRequest(Resource capability,
List<Allocation> allocations) {
for (OpportunisticCon... | 3.68 |
hadoop_ShortWritable_write | /** write short value */
@Override
public void write(DataOutput out) throws IOException {
out.writeShort(value);
} | 3.68 |
flink_AvroDeserializationSchema_forSpecific | /**
* Creates {@link AvroDeserializationSchema} that produces classes that were generated from avro
* schema.
*
* @param tClass class of record to be produced
* @param encoding Avro serialization approach to use for decoding
* @return deserialized record
*/
public static <T extends SpecificRecord> AvroDeserializ... | 3.68 |
hudi_AvroSchemaUtils_checkSchemaCompatible | /**
* Checks whether writer schema is compatible with table schema considering {@code AVRO_SCHEMA_VALIDATE_ENABLE}
* and {@code SCHEMA_ALLOW_AUTO_EVOLUTION_COLUMN_DROP} options.
* To avoid collision of {@code SCHEMA_ALLOW_AUTO_EVOLUTION_COLUMN_DROP} and {@code DROP_PARTITION_COLUMNS}
* partition column names should... | 3.68 |
hibernate-validator_ConstraintTypeStaxBuilder_run | /**
* Runs the given privileged action, using a privileged block if required.
*
* <b>NOTE:</b> This must never be changed into a publicly available method to avoid execution of arbitrary
* privileged actions within HV's protection domain.
*/
@IgnoreForbiddenApisErrors(reason = "SecurityManager is deprecated in JDK... | 3.68 |
hbase_ResponseConverter_buildRunCatalogScanResponse | /**
* Creates a response for the catalog scan request
* @return A RunCatalogScanResponse
*/
public static RunCatalogScanResponse buildRunCatalogScanResponse(int numCleaned) {
return RunCatalogScanResponse.newBuilder().setScanResult(numCleaned).build();
} | 3.68 |
hbase_MoveWithAck_isSuccessfulScan | /**
* Tries to scan a row from passed region
*/
private void isSuccessfulScan(RegionInfo region) throws IOException {
Scan scan = new Scan().withStartRow(region.getStartKey()).setRaw(true).setOneRowLimit()
.setMaxResultSize(1L).setCaching(1).setFilter(new FirstKeyOnlyFilter()).setCacheBlocks(false);
try (Tabl... | 3.68 |
hadoop_ParsedTaskAttempt_dumpParsedTaskAttempt | /** Dump the extra info of ParsedTaskAttempt */
void dumpParsedTaskAttempt() {
LOG.info("ParsedTaskAttempt details:" + obtainCounters()
+ ";DiagnosticInfo=" + obtainDiagnosticInfo() + "\n"
+ obtainTrackerName() + ";" + obtainHttpPort() + ";"
+ obtainShufflePort() + ";rack=" + getHostName().getRackNa... | 3.68 |
framework_GridLayoutWithNonIntegerWidth_getTestDescription | /*
* (non-Javadoc)
*
* @see com.vaadin.tests.components.AbstractTestUI#getTestDescription()
*/
@Override
protected String getTestDescription() {
return "Neither of the panels should contain scrollbars";
} | 3.68 |
hbase_RecoverLeaseFSUtils_recoverFileLease | /**
* Recover the lease from HDFS, retrying multiple times.
*/
public static void recoverFileLease(FileSystem fs, Path p, Configuration conf,
CancelableProgressable reporter) throws IOException {
if (fs instanceof FilterFileSystem) {
fs = ((FilterFileSystem) fs).getRawFileSystem();
}
// lease recovery not... | 3.68 |
hadoop_RecordStore_getDriver | /**
* Get the State Store driver.
*
* @return State Store driver.
*/
public StateStoreDriver getDriver() {
return this.driver;
} | 3.68 |
hadoop_OBSDataBlocks_create | /**
* Create a temp file and a {@link DiskBlock} instance to manage it.
*
* @param index block index
* @param limit limit of the block.
* @return the new block
* @throws IOException IO problems
*/
@Override
DataBlock create(final long index, final int limit) throws IOException {
File destFile = createTmpFileFo... | 3.68 |
framework_AbstractSingleSelect_setSelectedItem | /**
* This method updates the internal selection state of the server-side of
* {@code AbstractSingleSelect}.
*
* @param value
* the value that should be selected
* @param userOriginated
* {@code true} if selection was done by user, {@code false} if
* not
*
* @since 8.5
*/
pro... | 3.68 |
flink_DefaultLookupCache_maximumSize | /** Specifies the maximum number of entries of the cache. */
public Builder maximumSize(long maximumSize) {
this.maximumSize = maximumSize;
return this;
} | 3.68 |
hadoop_DelegationTokenIdentifier_stringifyToken | /** @return a string representation of the token */
public static String stringifyToken(final Token<?> token) throws IOException {
DelegationTokenIdentifier ident = new DelegationTokenIdentifier();
ByteArrayInputStream buf = new ByteArrayInputStream(token.getIdentifier());
DataInputStream in = new DataInputStream... | 3.68 |
hibernate-validator_ValidatorImpl_validateReturnValueForGroup | //TODO GM: if possible integrate with validateParameterForGroup()
private <T> void validateReturnValueForGroup(BaseBeanValidationContext<T> validationContext, ExecutableMetaData executableMetaData, T bean, Object value,
Group group) {
Contracts.assertNotNull( executableMetaData, "executableMetaData may not be null" ... | 3.68 |
pulsar_OffloadPoliciesImpl_mergeConfiguration | /**
* Merge different level offload policies.
*
* <p>policies level priority: topic > namespace > broker
*
* @param topicLevelPolicies topic level offload policies
* @param nsLevelPolicies namespace level offload policies
* @param brokerProperties broker level offload configuration
* @return offload policies
*... | 3.68 |
hibernate-validator_Sequence_addInheritedGroups | /**
* Recursively add inherited (groups defined on superclasses).
*
* @param group the group for which the inherited groups need to be added to {@code expandedGroups}
* @param expandedGroups The list into which to add all groups
*/
private void addInheritedGroups(Group group, Set<Group> expandedGroups) {
for ( Cl... | 3.68 |
hadoop_TFile_begin | /**
* Get the begin location of the TFile.
*
* @return If TFile is not empty, the location of the first key-value pair.
* Otherwise, it returns end().
*/
Location begin() {
return begin;
} | 3.68 |
flink_LogicalTypeChecks_getFieldCount | /** Returns the field count of row and structured types. Other types return 1. */
public static int getFieldCount(LogicalType logicalType) {
return logicalType.accept(FIELD_COUNT_EXTRACTOR);
} | 3.68 |
framework_VSlider_setResolution | /**
* Sets the resolution (precision level) for slider as the number of
* fractional digits that are considered significant. Determines how big
* change is used when increasing or decreasing the value, and where more
* precise values get rounded.
*
* @param resolution
* the number of digits after the ... | 3.68 |
framework_Range_contains | /**
* Checks whether an integer is found within this range.
*
* @param integer
* an integer to test for presence in this range
* @return <code>true</code> if <code>integer</code> is in this range
*/
public boolean contains(final int integer) {
return getStart() <= integer && integer < getEnd();
} | 3.68 |
hbase_TimeRangeTracker_toByteArray | /**
* This method used to serialize TimeRangeTracker (TRT) by protobuf while this breaks the forward
* compatibility on HFile.(See HBASE-21008) In previous hbase version ( < 2.0.0 ) we use
* DataOutput to serialize TRT, these old versions don't have capability to deserialize TRT which
* is serialized by protobuf. S... | 3.68 |
hmily_HmilyReflector_executor | /**
* Executor object.
*
* @param action the action
* @param executorType the executor type
* @param hmilyParticipant the hmily participant
* @return the object
* @throws Exception the exception
*/
public static Object executor(final HmilyActionEnum action, final ExecutorTypeEnum executorType, fin... | 3.68 |
flink_CoreOptions_fileSystemConnectionLimitIn | /**
* The total number of input connections that a file system for the given scheme may open.
* Unlimited be default.
*/
public static ConfigOption<Integer> fileSystemConnectionLimitIn(String scheme) {
return ConfigOptions.key("fs." + scheme + ".limit.input").intType().defaultValue(-1);
} | 3.68 |
pulsar_ZKSessionWatcher_checkConnectionStatus | // task that runs every TICK_TIME to check zk connection
// NOT ThreadSafe:
// If zk client can't ensure the order, it may lead to problems.
// Currently,we only use it in single thread, it will be fine. but we shouldn't leave any potential problems
// in the future.
private void checkConnectionStatus() {
try {
... | 3.68 |
flink_SharedResourceHolder_get | /**
* Try to get an existing instance of the given resource. If an instance does not exist, create
* a new one with the given factory.
*
* @param resource the singleton object that identifies the requested static resource
*/
public static <T> T get(Resource<T> resource) {
return holder.getInternal(resource);
} | 3.68 |
hadoop_ClusterMetrics_getRunningReduces | /**
* Get the number of running reduce tasks in the cluster.
*
* @return running reduces
*/
public int getRunningReduces() {
return runningReduces;
} | 3.68 |
dubbo_ApplicationModel_getApplicationConfig | /**
* @deprecated Replace to {@link ApplicationModel#getCurrentConfig()}
*/
@Deprecated
public static ApplicationConfig getApplicationConfig() {
return defaultModel().getCurrentConfig();
} | 3.68 |
hadoop_StagingCommitter_getTaskAttemptPath | /**
* Compute the path where the output of a task attempt is stored until
* that task is committed.
*
* @param context the context of the task attempt.
* @param out The output path to put things in.
* @return the path where a task attempt should be stored.
*/
public static Path getTaskAttemptPath(TaskAttemptCont... | 3.68 |
hadoop_ActiveAuditManagerS3A_noteSpanReferenceLost | /**
* Span reference lost from GC operations.
* This is only called when an attempt is made to retrieve on
* the active thread or when a prune operation is cleaning up.
*
* @param threadId thread ID.
*/
private void noteSpanReferenceLost(long threadId) {
auditor.noteSpanReferenceLost(threadId);
} | 3.68 |
pulsar_PortManager_nextLockedFreePort | /**
* Return a locked available port.
*
* @return locked available port.
*/
public static synchronized int nextLockedFreePort() {
int exceptionCount = 0;
while (true) {
try (ServerSocket ss = new ServerSocket(0)) {
int port = ss.getLocalPort();
if (!checkPortIfLocked(port)) {... | 3.68 |
flink_ZooKeeperUtils_fromConfig | /**
* Return the configured {@link ZkClientACLMode}.
*
* @param config The config to parse
* @return Configured ACL mode or the default defined by {@link
* HighAvailabilityOptions#ZOOKEEPER_CLIENT_ACL} if not configured.
*/
public static ZkClientACLMode fromConfig(Configuration config) {
String aclMode = ... | 3.68 |
hadoop_BlockManagerParameters_getConf | /**
* @return The configuration object.
*/
public Configuration getConf() {
return conf;
} | 3.68 |
flink_DynamicSourceUtils_prepareDynamicSource | /**
* Prepares the given {@link DynamicTableSource}. It check whether the source is compatible with
* the given schema and applies initial parameters.
*/
public static void prepareDynamicSource(
String tableDebugName,
ResolvedCatalogTable table,
DynamicTableSource source,
boolean isBa... | 3.68 |
framework_VCalendarPanel_focusPreviousMonth | /**
* Selects the previous month
*/
private void focusPreviousMonth() {
if (focusedDate == null) {
return;
}
Date requestedPreviousMonthDate = (Date) focusedDate.clone();
removeOneMonth(requestedPreviousMonthDate);
if (!isDateInsideRange(requestedPreviousMonthDate, Resolution.MONTH)) {
... | 3.68 |
hadoop_UpdateContainerTokenEvent_isResourceChange | /**
* Is this update a ResourceChange.
*
* @return isResourceChange.
*/
public boolean isResourceChange() {
return isResourceChange;
} | 3.68 |
hadoop_AbfsTokenRenewer_handleKind | /**
* Checks if this particular object handles the Kind of token passed.
*
* @param kind the kind of the token
* @return true if it handles passed token kind false otherwise.
*/
@Override
public boolean handleKind(Text kind) {
return AbfsDelegationTokenIdentifier.TOKEN_KIND.equals(kind);
} | 3.68 |
framework_Escalator_insertColumns | /**
* {@inheritDoc}
* <p>
* <em>Implementation detail:</em> This method does no DOM modifications
* (i.e. is very cheap to call) if there is no data for rows when this
* method is called.
*
* @see #hasColumnAndRowData()
*/
@Override
public void insertColumns(final int index, final int numberOfColumns) {
// ... | 3.68 |
hbase_RegionServerObserver_postReplicationSinkBatchMutate | /**
* This will be called after replication sink mutations are executed on the sink table as part of
* batch call.
* @param ctx the environment to interact with the framework and region server.
* @param walEntry wal entry from which mutation is formed.
* @param mutation mutation to be applied at sink cluster.... | 3.68 |
hbase_HBaseTestingUtility_deleteTable | /**
* Drop an existing table
* @param tableName existing table
*/
public void deleteTable(TableName tableName) throws IOException {
try {
getAdmin().disableTable(tableName);
} catch (TableNotEnabledException e) {
LOG.debug("Table: " + tableName + " already disabled, so just deleting it.");
}
getAdmin... | 3.68 |
hudi_ConsistentBucketIndexBulkInsertPartitionerWithRows_initializeBucketIdentifier | /**
* Initialize hashing metadata of input records. The metadata of all related partitions will be loaded, and
* the mapping from partition to its bucket identifier is constructed.
*/
private Map<String, ConsistentBucketIdentifier> initializeBucketIdentifier(JavaRDD<Row> rows) {
return rows.map(this.extractor::get... | 3.68 |
framework_LegacyCommunicationManager_isConnectorVisibleToClient | /**
* Checks if the connector is visible in context. For Components,
* {@link #isComponentVisibleToClient(Component)} is used. For other types
* of connectors, the contextual visibility of its first Component ancestor
* is used. If no Component ancestor is found, the connector is not visible.
*
* @deprecated As o... | 3.68 |
flink_NetUtils_parseHostPortAddress | /**
* Converts a string of the form "host:port" into an {@link InetSocketAddress}.
*
* @param hostPort The "host:port" string.
* @return The converted InetSocketAddress.
*/
public static InetSocketAddress parseHostPortAddress(String hostPort) {
URL url = validateHostPortString(hostPort);
return new InetSoc... | 3.68 |
hbase_ThriftUtilities_resultsFromHBase | /**
* Converts multiple {@link Result}s (HBase) into a list of {@link TResult}s (Thrift).
* @param in array of <code>Result</code>s to convert
* @return list of converted <code>TResult</code>s
* @see #resultFromHBase(Result)
*/
public static List<TResult> resultsFromHBase(Result[] in) {
List<TResult> out = new A... | 3.68 |
hibernate-validator_MappingXmlParser_run | /**
* Runs the given privileged action, using a privileged block if required.
* <p>
* <b>NOTE:</b> This must never be changed into a publicly available method to avoid execution of arbitrary
* privileged actions within HV's protection domain.
*/
@IgnoreForbiddenApisErrors(reason = "SecurityManager is deprecated in... | 3.68 |
flink_PartitionCommitPolicy_validatePolicyChain | /** Validate commit policy. */
static void validatePolicyChain(boolean isEmptyMetastore, String policyKind) {
if (policyKind != null) {
String[] policyStrings = policyKind.split(",");
for (String policy : policyStrings) {
if (isEmptyMetastore && METASTORE.equalsIgnoreCase(policy)) {
... | 3.68 |
dubbo_AbstractServerCall_buildInvocation | /**
* Build the RpcInvocation with metadata and execute headerFilter
*
* @return RpcInvocation
*/
protected RpcInvocation buildInvocation(MethodDescriptor methodDescriptor) {
final URL url = invoker.getUrl();
RpcInvocation inv = new RpcInvocation(
url.getServiceModel(),
methodDescrip... | 3.68 |
querydsl_SimpleExpression_when | /**
* Create a case expression builder
*
* @param other
* @return case expression builder
*/
public CaseForEqBuilder<T> when(Expression<? extends T> other) {
return new CaseForEqBuilder<T>(mixin, other);
} | 3.68 |
flink_TypeExtractor_createTypeInfoFromInput | /**
* Finds the type information to a type variable.
*
* <p>It solve the following:
*
* <p>Return the type information for "returnTypeVar" given that "inType" has type information
* "inTypeInfo". Thus "inType" must contain "returnTypeVar" in a "inputTypeHierarchy", otherwise
* null is returned.
*/
private <IN1>... | 3.68 |
hadoop_AbstractClientRequestInterceptor_shutdown | /**
* Disposes the {@link ClientRequestInterceptor}.
*/
@Override
public void shutdown() {
if (this.nextInterceptor != null) {
this.nextInterceptor.shutdown();
}
} | 3.68 |
AreaShop_RentRegion_getTimeLeftString | /**
* Get a formatted string indicating the rent time that is left.
* @return Time left on the rent, for example '29 days', '3 months', '1 second'
*/
public String getTimeLeftString() {
return Utils.millisToHumanFormat(getTimeLeft());
} | 3.68 |
hadoop_BufferData_setCaching | /**
* Indicates that a caching operation is in progress.
*
* @param actionFuture the {@code Future} of a caching action.
*
* @throws IllegalArgumentException if actionFuture is null.
*/
public synchronized void setCaching(Future<Void> actionFuture) {
Validate.checkNotNull(actionFuture, "actionFuture");
this.... | 3.68 |
hbase_MetricsConnection_getPutTracker | /** putTracker metric */
public CallTracker getPutTracker() {
return putTracker;
} | 3.68 |
framework_VAbstractDropHandler_dragOver | /**
* Default implementation does nothing.
*/
@Override
public void dragOver(VDragEvent drag) {
} | 3.68 |
framework_DetailsManagerConnector_getDetailsComponentConnectorId | /**
* Returns the connector id for a details component.
*
* @param rowIndex
* the row index of details component
* @return connector id; {@code null} if row or id is not found
*/
private String getDetailsComponentConnectorId(int rowIndex) {
JsonObject row = getWidget().getDataSource().getRow(rowInd... | 3.68 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.