name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hbase_PrivateCellUtil_compare | /**
* Used when a cell needs to be compared with a key byte[] such as cases of finding the index from
* the index block, bloom keys from the bloom blocks This byte[] is expected to be serialized in
* the KeyValue serialization format If the KeyValue (Cell's) serialization format changes this
* method cannot be used... | 3.68 |
hadoop_RBFMetrics_locateGetter | /**
* Finds the appropriate getter for a field name.
*
* @param fieldName The legacy name of the field.
* @return The matching getter or null if not found.
*/
private static Method locateGetter(BaseRecord record, String fieldName) {
for (Method m : record.getClass().getMethods()) {
if (m.getName().equalsIgno... | 3.68 |
flink_RunLengthDecoder_readNextGroup | /** Reads the next group. */
void readNextGroup() {
try {
int header = readUnsignedVarInt();
this.mode = (header & 1) == 0 ? MODE.RLE : MODE.PACKED;
switch (mode) {
case RLE:
this.currentCount = header >>> 1;
this.currentValue = readIntLittleEndian... | 3.68 |
framework_RangeValidator_setMinValueIncluded | /**
* Sets whether the minimum value is part of the accepted range.
*
* @param minValueIncluded
* true if the minimum value should be part of the range, false
* otherwise
*/
public void setMinValueIncluded(boolean minValueIncluded) {
this.minValueIncluded = minValueIncluded;
} | 3.68 |
hbase_BalancerClusterState_registerRegion | /** Helper for Cluster constructor to handle a region */
private void registerRegion(RegionInfo region, int regionIndex, int serverIndex,
Map<String, Deque<BalancerRegionLoad>> loads, RegionHDFSBlockLocationFinder regionFinder) {
String tableName = region.getTable().getNameAsString();
if (!tablesToIndex.containsK... | 3.68 |
flink_StreamExecutionEnvironment_getConfig | /** Gets the config object. */
public ExecutionConfig getConfig() {
return config;
} | 3.68 |
hadoop_AbfsClientThrottlingAnalyzer_addBytesTransferred | /**
* Updates metrics with results from the current storage operation.
*
* @param count The count of bytes transferred.
* @param isFailedOperation True if the operation failed; otherwise false.
*/
public void addBytesTransferred(long count, boolean isFailedOperation) {
AbfsOperationMetrics metrics = ... | 3.68 |
morf_SqlServerMetaDataProvider_isPrimaryKeyIndex | /**
* @see org.alfasoftware.morf.jdbc.DatabaseMetaDataProvider#isPrimaryKeyIndex(RealName)
*/
@Override
protected boolean isPrimaryKeyIndex(RealName indexName) {
return indexName.getDbName().endsWith("_PK");
} | 3.68 |
framework_AbstractComponent_setVisible | /*
* (non-Javadoc)
*
* @see com.vaadin.ui.Component#setVisible(boolean)
*/
@Override
public void setVisible(boolean visible) {
if (isVisible() == visible) {
return;
}
this.visible = visible;
if (visible) {
/*
* If the visibility state is toggled from invisible to visible it... | 3.68 |
morf_FieldLiteral_toString | /**
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
return (dataType.equals(DataType.STRING)
? "\"" + value + "\""
: value == null ? "NULL" : value) + super.toString();
} | 3.68 |
framework_FileUploadHandler_removePath | /**
* Removes any possible path information from the filename and returns the
* filename. Separators / and \\ are used.
*
* @param filename
* @return
*/
private static String removePath(String filename) {
if (filename != null) {
filename = filename.replaceAll("^.*[/\\\\]", "");
}
return filen... | 3.68 |
Activiti_BaseEntityEventListener_onEntityEvent | /**
* Called when an event is received, which is not a create, an update or delete.
*/
protected void onEntityEvent(ActivitiEvent event) {
// Default implementation is a NO-OP
} | 3.68 |
hudi_HoodieAvroUtils_wrapValueIntoAvro | /**
* Wraps a value into Avro type wrapper.
*
* @param value Java value.
* @return A wrapped value with Avro type wrapper.
*/
public static Object wrapValueIntoAvro(Comparable<?> value) {
if (value == null) {
return null;
} else if (value instanceof Date || value instanceof LocalDate) {
// NOTE: Due to... | 3.68 |
hbase_SplitTableRegionProcedure_splitStoreFiles | /**
* Create Split directory
* @param env MasterProcedureEnv
*/
private Pair<List<Path>, List<Path>> splitStoreFiles(final MasterProcedureEnv env,
final HRegionFileSystem regionFs) throws IOException {
final Configuration conf = env.getMasterConfiguration();
TableDescriptor htd = env.getMasterServices().getTab... | 3.68 |
framework_VLayoutSlot_positionInDirection | /**
* Position the slot vertically and set the height and the bottom margin, or
* horizontally and set the width and the right margin, depending on the
* indicated direction.
*
* @param currentLocation
* the top position or the left position for this slot depending
* on the indicated direct... | 3.68 |
hadoop_ReencryptionHandler_reencryptEncryptionZone | /**
* Re-encrypts a zone by recursively iterating all paths inside the zone,
* in lexicographic order.
* Files are re-encrypted, and subdirs are processed during iteration.
*
* @param zoneId the Zone's id.
* @throws IOException
* @throws InterruptedException
*/
void reencryptEncryptionZone(final long zoneId)
... | 3.68 |
dubbo_MessageFormatter_arrayFormat | /**
* Same principle as the {@link #format(String, Object)} and
* {@link #format(String, Object, Object)} methods except that any number of
* arguments can be passed in an array.
*
* @param messagePattern The message pattern which will be parsed and formatted
* @param argArray An array of arguments to be su... | 3.68 |
framework_ConnectorTracker_getCurrentSyncId | /**
* Gets the most recently generated server sync id.
* <p>
* The sync id is incremented by one whenever a new response is being
* written. This id is then sent over to the client. The client then adds
* the most recent sync id to each communication packet it sends back to the
* server. This way, the server know... | 3.68 |
hadoop_HadoopLogsAnalyzer_readBalancedLine | // This can return either the Pair of the !!file line and the XMLconf
// file, or null and an ordinary line. Returns just null if there's
// no more input.
private Pair<String, String> readBalancedLine() throws IOException {
String line = readCountedLine();
if (line == null) {
return null;
}
while (line.i... | 3.68 |
framework_RefreshRenderedCellsOnlyIfAttached_removeTableParent | /**
* Remove Table's parent component.
*
*/
protected void removeTableParent() {
removeComponent(layout);
} | 3.68 |
hbase_DumpRegionServerMetrics_dumpMetrics | /**
* Dump out a subset of regionserver mbeans only, not all of them, as json on System.out.
*/
public static String dumpMetrics() throws MalformedObjectNameException, IOException {
StringWriter sw = new StringWriter(1024 * 100); // Guess this size
try (PrintWriter writer = new PrintWriter(sw)) {
JSONBean dum... | 3.68 |
hadoop_OBSFileSystem_getUri | /**
* Return a URI whose scheme and authority identify this FileSystem.
*
* @return the URI of this filesystem.
*/
@Override
public URI getUri() {
return uri;
} | 3.68 |
hbase_SimpleRpcServerResponder_processAllResponses | /**
* Process all the responses for this connection
* @return true if all the calls were processed or that someone else is doing it. false if there
* is still some work to do. In this case, we expect the caller to delay us.
*/
private boolean processAllResponses(final SimpleServerRpcConnection connection)
... | 3.68 |
hadoop_HsNavBlock_render | /*
* (non-Javadoc)
* @see org.apache.hadoop.yarn.webapp.view.HtmlBlock#render(org.apache.hadoop.yarn.webapp.view.HtmlBlock.Block)
*/
@Override protected void render(Block html) {
DIV<Hamlet> nav = html.
div("#nav").
h3("Application").
ul().
li().a(url("about"), "About").__().
li().a(u... | 3.68 |
hadoop_JobMetaData_createSkyline | /**
* Normalized container launch/release time, and generate the
* {@link ResourceSkyline}.
*/
public final void createSkyline() {
final long jobSubmissionTime = resourceSkyline.getJobSubmissionTime();
Resource containerSpec = resourceSkyline.getContainerSpec();
final TreeMap<Long, Resource> resourceOverTime =... | 3.68 |
morf_AbstractSqlDialectTest_testInsertWithAutoGeneratedId | /**
* Tests that an insert from a select works when no defaults are supplied.
*/
@Test
public void testInsertWithAutoGeneratedId() {
SelectStatement sourceStmt = new SelectStatement(new FieldReference("version"),
new FieldReference(STRING_FIELD))
.from(new TableReference(OTHER_TABLE));
InsertStatement stmt... | 3.68 |
morf_AddIndex_getNewIndex | /**
* @return The new index.
*/
public Index getNewIndex() {
return newIndex;
} | 3.68 |
flink_ResourceCounter_withResources | /**
* Creates a resource counter with the specified set of resources.
*
* @param resources resources with which to initialize the resource counter
* @return ResourceCounter which contains the specified set of resources
*/
public static ResourceCounter withResources(Map<ResourceProfile, Integer> resources) {
re... | 3.68 |
hadoop_Retryer_updateStatus | /**
* Returns true if status update interval has been reached.
*
* @return true if status update interval has been reached.
*/
public boolean updateStatus() {
return (this.delay > 0) && this.delay % this.statusUpdateInterval == 0;
} | 3.68 |
dubbo_MetadataInfo_getServiceInfo | /**
* Get service info of an interface with specified group, version and protocol
* @param protocolServiceKey key is of format '{group}/{interface name}:{version}:{protocol}'
* @return the specific service info related to protocolServiceKey
*/
public ServiceInfo getServiceInfo(String protocolServiceKey) {
retur... | 3.68 |
flink_UserDefinedFunctionHelper_instantiateFunction | /**
* Instantiates a {@link UserDefinedFunction} assuming a JVM function with default constructor.
*/
@SuppressWarnings({"unchecked", "rawtypes"})
public static UserDefinedFunction instantiateFunction(Class<?> functionClass) {
if (!UserDefinedFunction.class.isAssignableFrom(functionClass)) {
throw new Val... | 3.68 |
morf_SchemaValidator_equals | /**
* {@inheritDoc}
*
* @see java.lang.Object#equals(java.lang.Object)
*/
@Override
public boolean equals(Object obj) {
if (!(obj instanceof IndexSignature)) return false;
IndexSignature other = (IndexSignature) obj;
return Objects.equals(other.index.columnNames(), index.columnNames()) && other.index.isUniq... | 3.68 |
dubbo_StringUtils_hasText | /**
* Check the cs String whether contains non whitespace characters.
*
* @param cs
* @return
*/
public static boolean hasText(CharSequence cs) {
return !isBlank(cs);
} | 3.68 |
hmily_HmilyTccTransactionExecutor_participantConfirm | /**
* Participant confirm object.
*
* @param hmilyParticipantList the hmily participant list
* @param selfParticipantId the self participant id
* @return the object
*/
public Object participantConfirm(final List<HmilyParticipant> hmilyParticipantList, final Long selfParticipantId) {
if (CollectionUtils.isE... | 3.68 |
hbase_RpcServer_unsetCurrentCall | /**
* Used by {@link org.apache.hadoop.hbase.procedure2.store.region.RegionProcedureStore}. For
* master's rpc call, it may generate new procedure and mutate the region which store procedure.
* There are some check about rpc when mutate region, such as rpc timeout check. So unset the rpc
* call to avoid the rpc che... | 3.68 |
flink_ParameterTool_get | /**
* Returns the String value for the given key. If the key does not exist it will return null.
*/
@Override
public String get(String key) {
addToDefaults(key, null);
unrequestedParameters.remove(key);
return data.get(key);
} | 3.68 |
framework_VColorPickerArea_isOpen | /**
* Check the popup's marked state.
*
* @return true if the popup has been marked being open, false otherwise.
*/
public boolean isOpen() {
return isOpen;
} | 3.68 |
hadoop_RouterRMAdminService_init | /**
* Initializes the wrapper with the specified parameters.
*
* @param interceptor the first interceptor in the pipeline
*/
public synchronized void init(RMAdminRequestInterceptor interceptor) {
this.rootInterceptor = interceptor;
} | 3.68 |
morf_H2Dialect_getSqlForDateToYyyymmddHHmmss | /**
* @see org.alfasoftware.morf.jdbc.SqlDialect#getSqlForDateToYyyymmddHHmmss(org.alfasoftware.morf.sql.element.Function)
*/
@Override
protected String getSqlForDateToYyyymmddHHmmss(Function function) {
String sqlExpression = getSqlFrom(function.getArguments().get(0));
// Example for CURRENT_TIMESTAMP() -> 2015-... | 3.68 |
shardingsphere-elasticjob_ExecutionService_getDisabledItems | /**
* Get disabled sharding items.
*
* @param items sharding items need to be got
* @return disabled sharding items
*/
public List<Integer> getDisabledItems(final List<Integer> items) {
List<Integer> result = new ArrayList<>(items.size());
for (int each : items) {
if (jobNodeStorage.isJobNodeExiste... | 3.68 |
framework_ServiceInitEvent_getAddedConnectorIdGenerators | /**
* Gets an unmodifiable list of all connector id generators that have been
* added for the service.
*
* @return the current list of added connector id generators
*
* @since 8.1
*/
public List<ConnectorIdGenerator> getAddedConnectorIdGenerators() {
return Collections.unmodifiableList(addedConnectorIdGenera... | 3.68 |
hbase_SpaceQuotaRefresherChore_checkQuotaTableExists | /**
* Checks if hbase:quota exists in hbase:meta
* @return true if hbase:quota table is in meta, else returns false.
* @throws IOException throws IOException
*/
boolean checkQuotaTableExists() throws IOException {
try (Admin admin = getConnection().getAdmin()) {
return admin.tableExists(QuotaUtil.QUOTA_TABLE_... | 3.68 |
rocketmq-connect_BufferedRecords_executeUpdates | /**
* @return an optional count of all updated rows or an empty optional if no info is available
*/
private Optional<Long> executeUpdates() throws DorisException {
Optional<Long> count = Optional.empty();
if (updatePreparedRecords.isEmpty()) {
return count;
}
for (ConnectRecord record : update... | 3.68 |
framework_Overlay_getOwner | /**
* Get owner (Widget that made this Overlay, not the layout parent) of
* Overlay.
*
* @return Owner (creator) or null if not defined
*/
public Widget getOwner() {
return owner;
} | 3.68 |
flink_ExtractionUtils_getStructuredField | /**
* Returns the field of a structured type. The logic is as broad as possible to support both
* Java and Scala in different flavors.
*/
public static Field getStructuredField(Class<?> clazz, String fieldName) {
final String normalizedFieldName = fieldName.toUpperCase();
final List<Field> fields = collectS... | 3.68 |
hbase_HBaseRpcController_setTableName | /** Sets Region's table name. */
default void setTableName(TableName tableName) {
} | 3.68 |
flink_HiveParserRexNodeConverter_convertIN | // converts IN for constant value list, RexSubQuery won't get here
private RexNode convertIN(ExprNodeGenericFuncDesc func) throws SemanticException {
List<RexNode> childRexNodes = new ArrayList<>();
for (ExprNodeDesc childExpr : func.getChildren()) {
childRexNodes.add(convert(childExpr));
}
if (... | 3.68 |
hadoop_PlacementConstraintManager_validateConstraint | /**
* Validate a placement constraint and the set of allocation tags that will
* enable it.
*
* @param sourceTags the associated allocation tags
* @param placementConstraint the constraint
* @return true if constraint and tags are valid
*/
default boolean validateConstraint(Set<String> sourceTags,
PlacementC... | 3.68 |
hbase_SimpleRpcServer_setSocketSendBufSize | /**
* Sets the socket buffer size used for responding to RPCs.
* @param size send size
*/
@Override
public void setSocketSendBufSize(int size) {
this.socketSendBufferSize = size;
} | 3.68 |
flink_MutableHashTable_moveToNextBucket | /**
* Move to next bucket, return true while move to a on heap bucket, return false while move
* to a spilled bucket or there is no more bucket.
*/
private boolean moveToNextBucket() {
scanCount++;
if (scanCount > totalBucketNumber - 1) {
return false;
}
// move to next bucket, update all the... | 3.68 |
morf_AbstractSqlDialectTest_testCreateTableStatements | /**
* Tests the SQL for creating tables.
*/
@SuppressWarnings("unchecked")
@Test
public void testCreateTableStatements() {
Table table = metadata.getTable(TEST_TABLE);
Table alternate = metadata.getTable(ALTERNATE_TABLE);
Table nonNull = metadata.getTable(NON_NULL_TABLE);
Table compositePrimaryKey = metadata.... | 3.68 |
hadoop_AllocateRequest_schedulingRequests | /**
* Set the <code>schedulingRequests</code> of the request.
* @see AllocateRequest#setSchedulingRequests(List)
* @param schedulingRequests <code>SchedulingRequest</code> of the request
* @return {@link AllocateRequestBuilder}
*/
@Public
@Unstable
public AllocateRequestBuilder schedulingRequests(
List<Schedul... | 3.68 |
hudi_HoodieWriteCommitKafkaCallbackConfig_setCallbackKafkaConfigIfNeeded | /**
* Set default value for {@link HoodieWriteCommitKafkaCallbackConfig} if needed.
*/
public static void setCallbackKafkaConfigIfNeeded(HoodieConfig config) {
config.setDefaultValue(ACKS);
config.setDefaultValue(RETRIES);
} | 3.68 |
flink_SourceBuilder_fromFormat | /**
* Creates a new source that is bounded.
*
* @param env The stream execution environment.
* @param inputFormat The input source to consume.
* @param typeInfo The type of the output.
* @param <OUT> The output type.
* @return A source that is bounded.
*/
public static <OUT> DataStreamSource<OUT> fromFormat(
... | 3.68 |
hibernate-validator_ConstraintAnnotationVisitor_visitExecutableAsMethod | /**
* <p>
* Checks whether the given annotations are correctly specified at the given
* method. The following checks are performed:
* </p>
* <ul>
* <li>
* Constraint annotations may only be given at non-static, JavaBeans getter
* methods which's return type is supported by the constraints.</li>
* <li>
* The {... | 3.68 |
AreaShop_GeneralRegion_notifyAndUpdate | /**
* Broadcast the given event and update the region status.
* @param event The update event that should be broadcasted
*/
public void notifyAndUpdate(NotifyRegionEvent event) {
Bukkit.getPluginManager().callEvent(event);
update();
} | 3.68 |
flink_Transformation_getName | /** Returns the name of this {@code Transformation}. */
public String getName() {
return name;
} | 3.68 |
hadoop_VersionInfoMojo_computeMD5 | /**
* Computes and returns an MD5 checksum of the contents of all files in the
* input Maven FileSet.
*
* @return String containing hexadecimal representation of MD5 checksum
* @throws Exception if there is any error while computing the MD5 checksum
*/
private String computeMD5() throws Exception {
List<File> ... | 3.68 |
zxing_RSSExpandedReader_isPartialRow | // Returns true when one of the rows already contains all the pairs
private static boolean isPartialRow(Iterable<ExpandedPair> pairs, Iterable<ExpandedRow> rows) {
for (ExpandedRow r : rows) {
boolean allFound = true;
for (ExpandedPair p : pairs) {
boolean found = false;
for (ExpandedPair pp : r.g... | 3.68 |
flink_OperatorTransformation_bootstrapWith | /**
* Create a new {@link OneInputStateTransformation} from a {@link DataStream}.
*
* @param stream A data stream of elements.
* @param <T> The type of the input.
* @return A {@link OneInputStateTransformation}.
*/
public static <T> OneInputStateTransformation<T> bootstrapWith(DataStream<T> stream) {
return n... | 3.68 |
framework_AbstractDateField_setDateOutOfRangeMessage | /**
* Sets the current error message if the range validation fails.
*
* @param dateOutOfRangeMessage
* - Localizable message which is shown when value (the date) is
* set outside allowed range
*/
public void setDateOutOfRangeMessage(String dateOutOfRangeMessage) {
this.dateOutOfRangeMess... | 3.68 |
querydsl_NumberExpression_gt | /**
* Create a {@code this > right} expression
*
* @param <A>
* @param right rhs of the comparison
* @return {@code this > right}
* @see java.lang.Comparable#compareTo(Object)
*/
public final <A extends Number & Comparable<?>> BooleanExpression gt(Expression<A> right) {
return Expressions.booleanOperation(Op... | 3.68 |
hadoop_AuthenticationToken_isExpired | /**
* Returns true if the token has expired.
*
* @return true if the token has expired.
*/
public boolean isExpired() {
return super.isExpired();
} | 3.68 |
hbase_SingleColumnValueFilter_getQualifier | /** Returns the qualifier */
public byte[] getQualifier() {
return columnQualifier;
} | 3.68 |
hadoop_DynamicIOStatisticsBuilder_withLongFunctionMaximum | /**
* Add a new evaluator to the maximum statistics.
* @param key key of this statistic
* @param eval evaluator for the statistic
* @return the builder.
*/
public DynamicIOStatisticsBuilder withLongFunctionMaximum(String key,
ToLongFunction<String> eval) {
activeInstance().addMaximumFunction(key, eval::apply... | 3.68 |
framework_DragSourceExtension_getDragData | /**
* Get server side drag data. This data is available in the drop event and
* can be used to transfer data between drag source and drop target if they
* are in the same UI.
*
* @return Server side drag data if set, otherwise {@literal null}.
*/
public Object getDragData() {
return dragData;
} | 3.68 |
hadoop_BCFile_getInputStream | /**
* Get the output stream for BlockAppender's consumption.
*
* @return the output stream suitable for writing block data.
*/
public InputStream getInputStream() {
return in;
} | 3.68 |
flink_InMemoryPartition_isCompacted | /** @return true if garbage exists in partition */
public boolean isCompacted() {
return this.compacted;
} | 3.68 |
hadoop_Validate_checkWithinRange | /**
* Validates that the given value is within the given range of values.
* @param value the value to check.
* @param valueName the name of the argument.
* @param minValueInclusive inclusive lower limit for the value.
* @param maxValueInclusive inclusive upper limit for the value.
*/
public static void checkWithi... | 3.68 |
hbase_HRegion_cacheSkipWALMutationForRegionReplication | /**
* Here is for HBASE-26993,in order to make the new framework for region replication could work
* for SKIP_WAL, we save the {@link Mutation} which {@link Mutation#getDurability} is
* {@link Durability#SKIP_WAL} in miniBatchOp.
*/
@Override
protected void cacheSkipWALMutationForRegionReplication(
MiniBatchOpera... | 3.68 |
hudi_ClientIds_getHeartbeatFolderPath | // -------------------------------------------------------------------------
// Utilities
// -------------------------------------------------------------------------
private String getHeartbeatFolderPath(String basePath) {
return basePath + Path.SEPARATOR + AUXILIARYFOLDER_NAME + Path.SEPARATOR + HEARTBEAT_FOLDER_N... | 3.68 |
druid_MySqlStatementParser_parserParameters | /**
* parse create procedure parameters
*
* @param parameters
*/
private void parserParameters(List<SQLParameter> parameters, SQLObject parent) {
if (lexer.token() == Token.RPAREN) {
return;
}
for (; ; ) {
SQLParameter parameter = new SQLParameter();
if (lexer.token() == Token.... | 3.68 |
framework_Form_setImmediate | /**
* Setting the form to be immediate also sets all the fields of the form to
* the same state.
*/
@Override
public void setImmediate(boolean immediate) {
super.setImmediate(immediate);
for (Field<?> f : fields.values()) {
if (f instanceof AbstractLegacyComponent) {
((AbstractLegacyCompo... | 3.68 |
morf_TableNameDecorator_isTemporary | /**
* {@inheritDoc}
*
* @see org.alfasoftware.morf.metadata.Table#isTemporary()
*/
@Override
public boolean isTemporary() {
return false;
} | 3.68 |
framework_Calendar_getLastDateForWeek | /**
* Gets a date that is last day in the week that target given date belongs
* to.
*
* @param date
* Target date
* @return Date that is last date in same week that given date is.
*/
protected Date getLastDateForWeek(Date date) {
currentCalendar.setTime(date);
currentCalendar.add(java.util.Cal... | 3.68 |
hadoop_ReferenceCountMap_put | /**
* Add the reference. If the instance already present, just increase the
* reference count.
*
* @param key Key to put in reference map
* @return Referenced instance
*/
public E put(E key) {
E value = referenceMap.putIfAbsent(key, key);
if (value == null) {
value = key;
}
value.incrementAndGetRefCo... | 3.68 |
framework_BootstrapResponse_setUriResolver | /**
* Sets the URI resolver used in the bootstrap process.
*
* @param uriResolver
* the uri resolver which is used
* @since 8.1
*/
public void setUriResolver(VaadinUriResolver uriResolver) {
assert this.uriResolver == null : "URI resolver should never be changed";
assert uriResolver != null : "... | 3.68 |
flink_JobExceptionsInfoWithHistory_equals | // hashCode and equals are necessary for the test classes deriving from
// RestResponseMarshallingTestBase
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass() || !super.equals(o)) {
return false;
}
RootExceptionInfo ... | 3.68 |
morf_AbstractSqlDialectTest_testInsertWithNullLiterals | /**
* Test that an Insert statement is generated with a null value
*/
@Test
public void testInsertWithNullLiterals() {
InsertStatement stmt = new InsertStatement().into(new TableReference(ALTERNATE_TABLE))
.fields(
literal(1).as("id"),
literal(0).as("version"),
new NullFieldLiteral().a... | 3.68 |
morf_SqlDialect_getSubstringFunctionName | /**
* Gets the function name required to perform a substring command.
* <p>
* The default is provided here and should be overridden in child classes as
* neccessary.
* </p>
*
* @return The substring function name.
*/
protected String getSubstringFunctionName() {
return "SUBSTRING";
} | 3.68 |
graphhopper_TourStrategy_slightlyModifyDistance | /**
* Modifies the Distance up to +-10%
*/
protected double slightlyModifyDistance(double distance) {
double distanceModification = random.nextDouble() * .1 * distance;
if (random.nextBoolean())
distanceModification = -distanceModification;
return distance + distanceModification;
} | 3.68 |
framework_SortOrderBuilder_build | /**
* Returns an unmodifiable copy of the list of current sort orders in this
* sort builder.
*
* @return an unmodifiable sort order list
*/
public final List<T> build() {
return Collections.unmodifiableList(new ArrayList<>(sortOrders));
} | 3.68 |
flink_PackagingTestUtils_assertJarContainsOnlyFilesMatching | /**
* Verifies that all files in the jar match one of the provided allow strings.
*
* <p>An allow item ending on a {@code "/"} is treated as an allowed parent directory.
* Otherwise, it is treated as an allowed file.
*
* <p>For example, given a jar containing a file {@code META-INF/NOTICES}:
*
* <p>These would ... | 3.68 |
hadoop_CachingGetSpaceUsed_incDfsUsed | /**
* Increment the cached value of used space.
*
* @param value dfs used value.
*/
public void incDfsUsed(long value) {
used.addAndGet(value);
} | 3.68 |
framework_VCalendar_getDateTimeFormat | /**
* Get the date and time format to format the dates (includes both date and
* time).
*
* @return
*/
public DateTimeFormat getDateTimeFormat() {
return dateformat_datetime;
} | 3.68 |
flink_SourceOperator_initReader | /**
* Initializes the reader. The code from this method should ideally happen in the constructor or
* in the operator factory even. It has to happen here at a slightly later stage, because of the
* lazy metric initialization.
*
* <p>Calling this method explicitly is an optional way to have the reader initializatio... | 3.68 |
framework_SortOrderBuilder_thenDesc | /**
* Appends sorting with descending sort direction.
*
* @param by
* the object to sort by
* @return this sort builder
*/
public SortOrderBuilder<T, V> thenDesc(V by) {
return append(createSortOrder(by, SortDirection.DESCENDING));
} | 3.68 |
hadoop_LocalityMulticastAMRMProxyPolicy_isActiveAndEnabled | /**
* Returns true is the subcluster request is both active and enabled.
*/
private boolean isActiveAndEnabled(SubClusterId targetId) {
if (targetId == null) {
return false;
} else {
return getActiveAndEnabledSC().contains(targetId);
}
} | 3.68 |
flink_MetricQueryService_createMetricQueryService | /**
* Starts the MetricQueryService actor in the given actor system.
*
* @param rpcService The rpcService running the MetricQueryService
* @param resourceID resource ID to disambiguate the actor name
* @return actor reference to the MetricQueryService
*/
public static MetricQueryService createMetricQueryService(
... | 3.68 |
hbase_MasterObserver_postMoveServers | /**
* Called after servers are moved to target region server group
* @param ctx the environment to interact with the framework and master
* @param servers set of servers to move
* @param targetGroup name of group
*/
default void postMoveServers(final ObserverContext<MasterCoprocessorEnvironment> ctx,
... | 3.68 |
querydsl_Expressions_comparableTemplate | /**
* Create a new Template expression
*
* @param cl type of expression
* @param template template
* @param args template parameters
* @return template expression
*/
public static <T extends Comparable<?>> ComparableTemplate<T> comparableTemplate(Class<? extends T> cl, Template template, List<?> args) {
retu... | 3.68 |
flink_FactoryUtil_createTableFactoryHelper | /**
* Creates a utility that helps in discovering formats, merging options with {@link
* DynamicTableFactory.Context#getEnrichmentOptions()} and validating them all for a {@link
* DynamicTableFactory}.
*
* <p>The following example sketches the usage:
*
* <pre>{@code
* // in createDynamicTableSource()
* helper ... | 3.68 |
hudi_HoodieMetadataTableValidator_validateLatestFileSlices | /**
* Compare getLatestFileSlices between metadata table and fileSystem.
*/
private void validateLatestFileSlices(
HoodieMetadataValidationContext metadataTableBasedContext,
HoodieMetadataValidationContext fsBasedContext,
String partitionPath,
Set<String> baseDataFilesForCleaning) {
List<FileSlice> ... | 3.68 |
flink_TemplateUtils_findResultOnlyTemplates | /** Find a template that only specifies a result. */
static Set<FunctionResultTemplate> findResultOnlyTemplates(
Set<FunctionTemplate> functionTemplates,
Function<FunctionTemplate, FunctionResultTemplate> accessor) {
return functionTemplates.stream()
.filter(t -> t.getSignatureTemplate()... | 3.68 |
graphhopper_Helper_parseList | /**
* parses a string like [a,b,c]
*/
public static List<String> parseList(String listStr) {
String trimmed = listStr.trim();
if (trimmed.length() < 2)
return Collections.emptyList();
String[] items = trimmed.substring(1, trimmed.length() - 1).split(",");
List<String> result = new ArrayList<>(... | 3.68 |
hadoop_FSBuilder_opt | /**
* Pass an optional double parameter for the Builder.
* This parameter is converted to a long and passed
* to {@link #optLong(String, long)} -all
* decimal precision is lost.
* @param key key.
* @param value value.
* @return generic type B.
* @see #opt(String, String)
* @deprecated use {@link #optDouble(Str... | 3.68 |
hbase_Append_setTimeRange | /**
* Sets the TimeRange to be used on the Get for this append.
* <p>
* This is useful for when you have counters that only last for specific periods of time (ie.
* counters that are partitioned by time). By setting the range of valid times for this append,
* you can potentially gain some performance with a more o... | 3.68 |
dubbo_ReferenceBeanSupport_convertPropertyValues | /**
* Convert to raw props, without parsing nested config objects
*/
public static Map<String, Object> convertPropertyValues(MutablePropertyValues propertyValues) {
Map<String, Object> referenceProps = new LinkedHashMap<>();
for (PropertyValue propertyValue : propertyValues.getPropertyValueList()) {
S... | 3.68 |
flink_ColumnSummary_containsNull | /** True if this column contains any null values. */
public boolean containsNull() {
return getNullCount() > 0L;
} | 3.68 |
hadoop_ContainerReapContext_getContainer | /**
* Get the container set for the context.
*
* @return the {@link Container} set in the context.
*/
public Container getContainer() {
return container;
} | 3.68 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.