name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
hmily_LogUtil_error_rdh | /**
* Error.
*
* @param logger
* the logger
* @param supplier
* the supplier
*/
public static void error(final Logger logger, final Supplier<Object> supplier) {
if (logger.isErrorEnabled()) {
logger.error(Objects.toString(supplier.get()));
}
} | 3.26 |
hmily_LogUtil_debug_rdh | /**
* Debug.
*
* @param logger
* the logger
* @param supplier
* the supplier
*/
public static void debug(final Logger logger, final Supplier<Object> supplier) {
if (logger.isDebugEnabled()) {
logger.debug(Objects.toString(supplier.get()));
}
} | 3.26 |
hmily_MetricsTrackerFacade_start_rdh | /**
* Init for metrics tracker manager.
*
* @param metricsConfig
* metrics config
*/
public void start(final HmilyMetricsConfig metricsConfig) {
if (this.isStarted.compareAndSet(false, true)) {
metricsBootService = ExtensionLoaderFactory.load(MetricsBootService.class, metricsConfig.getMetricsName())... | 3.26 |
hmily_HmilyXaTransactionManager_setTxTotr_rdh | /**
* tx to threadLocal.
*/
private void setTxTotr(final Transaction transaction) {
synchronized(tms) {
Stack<Transaction> v19 = tms.get();
if (v19 == null) {
v19
= new Stack<>();
tms.set(v19);
}
v19.push(transaction);
}
} | 3.26 |
hmily_HmilyXaTransactionManager_getState_rdh | /**
* Gets state.
*
* @return the state
* @throws SystemException
* the system exception
*/
public Integer getState() throws SystemException {
Transaction v16 = getTransaction(); if (v16 == null) {
return XaState.STATUS_NO_T... | 3.26 |
hmily_HmilyXaTransactionManager_initialized_rdh | /**
* Initialized hmily xa transaction manager.
*
* @return the hmily xa transaction manager
*/
public static HmilyXaTransactionManager initialized() {return new HmilyXaTransactionManager();
} | 3.26 |
hmily_HmilyXaTransactionManager_getThreadTransaction_rdh | /**
* Gets thread transaction.
*
* @return the thread transaction
*/
public Transaction getThreadTransaction() {
synchronized(tms) {
Stack<Transaction> stack = tms.get();if (stack == null)
{
return null;
}
return stack.peek();
}
} | 3.26 |
hmily_HmilyXaTransactionManager_markTransactionRollback_rdh | /**
* 把事务标记为回滚状态.
*
* @param transId
* 事务id.
*/
public void markTransactionRollback(final String transId) {
if (transactionMap.containsKey(transId)) {
logger.warn("When rollback cmd is received, the business logic of transaction {} isn't stopped, " + "maybe there is a RPC timout.", transId);
... | 3.26 |
hmily_HmilyMetaDataManager_register_rdh | /**
* Register hmily metadata.
*
* @param hmilyTacResource
* the hmily resource
* @param databaseType
* database type
*/
public static void register(final HmilyTacResource hmilyTacResource, final DatabaseType databaseType) {
DataSourceMetaData dataSourceMetaData... | 3.26 |
hmily_HmilyMetaDataManager_get_rdh | /**
* Get data source meta data.
*
* @param resourceId
* the resource id
* @return data source metadata
*/
public static DataSourceMetaData get(final String resourceId) {
return DATASOURCE_META_CACHE.get(resourceId);
} | 3.26 |
hmily_TransactionImpl_doDeList_rdh | /**
* Do de list.
*
* @param flag
* the flag
* @throws SystemException
* the system exception
*/
public void doDeList(final int flag) throws SystemException {
delistResourceList = new ArrayList<>(enlistResourceList);
for (XAResource resource : delistResourceList) {
delistResource(resource, flag);
}
} | 3.26 |
hmily_TransactionImpl_getContext_rdh | /**
* Gets context.
*
* @return the context
*/
public TransactionContext getContext()
{
return context;
} | 3.26 |
hmily_TransactionImpl_createSubTransaction_rdh | /**
* 创建一个子任务.
*
* @return the transaction
*/public TransactionImpl createSubTransaction() {return new TransactionImpl(this);
} | 3.26 |
hmily_TransactionImpl_getXid_rdh | /**
* Gets xid.
*
* @return the xid
*/
public XidImpl getXid() {
return f0;
} | 3.26 |
hmily_TransactionImpl_doEnList_rdh | /**
* Do en list.
*
* @param xaResource
* the xa resource
* @param flag
* the flag
* @throws SystemException
* the system exception
* @throws RollbackException
* the rollback exception
*/
public void doEnList(final XAResource xaResource, final int flag) throws SystemException, RollbackException {
// ... | 3.26 |
hmily_SelectStatementAssembler_assembleHmilySelectStatement_rdh | /**
* Assemble Hmily select statement.
*
* @param selectStatement
* select statement
* @param hmilySelectStatement
* hmily select statement
* @return hmily select statement
*/
public static HmilySelectStatement assembleHmilySelectStatement(final SelectStatement selectStatement, final HmilySelectStatement h... | 3.26 |
hmily_HmilyParticipantUndoCacheManager_get_rdh | /**
* acquire hmilyTransaction.
*
* @param participantId
* this guava key.
* @return {@linkplain HmilyTransaction}
*/
public List<HmilyParticipantUndo> get(final Long participantId) {
try {
return loadingCache.get(participantId);
} catch (ExecutionException e) {
return Collections.emptyL... | 3.26 |
hmily_HmilyParticipantUndoCacheManager_cacheHmilyParticipantUndo_rdh | /**
* Cache hmily participant undo.
*
* @param participantId
* the participant id
* @param hmilyParticipantUndo
* the hmily participant undo
*/
public void cacheHmilyParticipantUndo(final Long participantId, final HmilyParticipantUndo hmilyParticipantUndo) {
List<HmilyParticipantUndo> existList = get(pa... | 3.26 |
hmily_HmilyParticipantUndoCacheManager_removeByKey_rdh | /**
* remove guava cache by key.
*
* @param participantId
* guava cache key.
*/
public void removeByKey(final Long participantId) {
if (Objects.nonNull(participantId)) {
loadingCache.invalidate(participantId);
}
} | 3.26 |
hmily_SQLImageMapperFactory_newInstance_rdh | /**
* Create new instance of SQL image mapper.
*
* @param sqlTuple
* SQL tuple
* @return SQL image mapper
*/
public static SQLImageMapper newInstance(final HmilySQLTuple sqlTuple) {
switch (sqlTuple.getManipulationType()) {
case INSERT :
return new InsertSQLImageMapper(sqlTuple.getTable... | 3.26 |
hmily_XaResourcePool_removeResource_rdh | /**
* 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);
}
... | 3.26 |
hmily_XaResourcePool_addResource_rdh | /**
* Add resource.
*
* @param xid
* the xid
* @param xaResourceWrapped
* the xa resource wrapped
*/
public synchronized void addResource(final Xid xid, final XaResourceWrapped xaResourceWrapped) {
pool.put(xid, xaResourceWrapped);
// 处理一下xid;
String globalId = new String(xid.getGlobalTransac... | 3.26 |
hmily_XaResourcePool_getResource_rdh | /**
* Gets resource.
*
* @param xid
* the xid
* @return the resource
*/
public XaResourceWrapped getResource(final Xid xid) {
XaResourceWrapped xaResourceWrapped = pool.get(xid);
// if (xaResourceWrapped == null) {
// //todo:从日志中查找.
// }
return xaResourceWrapped;
} | 3.26 |
hmily_XaResourcePool_getAllResource_rdh | /**
* Gets all resource.
*
* @param globalId
* the global id
* @return the all resource
*/
public List<XaResourceWrapped> getAllResource(final String globalId) {
Set<Xid> xids = this.xids.get(globalId);
if (xids != null) {
return xids.stream().map(this::getResource).collect(Collectors.toList());... | 3.26 |
hmily_XaResourcePool_removeAll_rdh | /**
* Remove all.
*
* @param globalId
* the global id
*/
public void removeAll(final String globalId) {
Set<Xid> xids = this.xids.get(globalId);
if (xids != null) {
for (final Xid xid : xids) {removeResource(xid);
}
this.xids.remove(globalId);
}
} | 3.26 |
hmily_DefaultValueUtils_getDefaultValue_rdh | /**
* Gets default value.
*
* @param clazz
* the clazz
* @return the default value
* @throws IllegalAccessException
* the illegal access exception
* @throws InvocationTargetException
* the invocation target exception
* @throws InstantiationException
* the instantiation exception
*/
public static Obj... | 3.26 |
hmily_SwaggerConfig_apiInfo_rdh | /**
* Api info api info.
*
* @return the api info
*/
private ApiInfo apiInfo() {
return new ApiInfoBuilder().title("Swagger API").description("dubbo分布式事务解决方案之Hmily测试体验").license("Apache 2.0").licenseUrl("http://www.apache.org/licenses/LICENSE-2.0.html").termsOfServiceUrl("").version(VERSION).contact(new Contact... | 3.26 |
hmily_SwaggerConfig_api_rdh | /**
* Api docket.
*
* @return the docket
*/
@Beanpublic Docket api() {
return // .paths(paths())
new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo()).select().apis(RequestHandlerSelectors.withClassAnnotation(RestController.class)).build().pathMapping("/").directModelSubstitute(LocalDate.class, String.... | 3.26 |
hmily_HmilyTacLocalParticipantExecutor_cancel_rdh | /**
* Do cancel.
*
* @param participant
* hmily participant
*/
public static void cancel(final HmilyParticipant participant) {
List<HmilyParticipantUndo> undoList = HmilyParticipantUndoCacheManager.getInstance().get(participant.getParticipantId());
for (HmilyParticipantUndo undo : undoList) {
boo... | 3.26 |
hmily_HmilyTacLocalParticipantExecutor_confirm_rdh | /**
* Do confirm.
*
* @param participant
* hmily participant
*/
public static void confirm(final HmilyParticipant participant) {
List<HmilyParticipantUndo> undoList = HmilyParticipantUndoCacheManager.getInstance().get(participant.getParticipantId());
for (HmilyParticipantUndo undo : undoList) {cleanUndo(... | 3.26 |
hmily_HmilyTransactionRecoveryService_m0_rdh | /**
* Confirm.
*
* @param hmilyParticipant
* the hmily participant
* @return the boolean
*/
public boolean m0(final HmilyParticipant hmilyParticipant) {
try {
HmilyReflector.executor(HmilyActionEnum.CONFIRMING, ExecutorTypeEnum.LOCAL, hmilyParticipant);
... | 3.26 |
hmily_HmilyTransactionRecoveryService_cancel_rdh | /**
* Cancel.
*
* @param hmilyParticipant
* the hmily participant
* @return the boolean
*/
public boolean cancel(final HmilyParticipant hmilyParticipant) {
try {
HmilyReflector.executor(HmilyActionEnum.CANCELING, ExecutorTypeEnum.LOCAL, hmilyParticipant);
removeHmilyParticipant(hmilyPartici... | 3.26 |
hmily_HmilySQLUtil_m0_rdh | /**
* Get exactly SQL expression.
*
* <p>remove space for SQL expression</p>
*
* @param value
* SQL expression
* @return exactly SQL expression
*/
public static String m0(final String value) {
return Strings.isNullOrEmpty(value) ? value : CharMatcher.anyOf(" ").r... | 3.26 |
hmily_HmilySQLUtil_m1_rdh | /**
* Determine whether SQL is read-only.
*
* @param sqlStatement
* SQL statement
* @return true if read-only, otherwise false
*/
public static boolean m1(final HmilyStatement sqlStatement) {
if (sqlStatement instanceof HmilyDMLStatement) {
return m1(((HmilyDMLStatement) (sqlStatement)));
}
... | 3.26 |
hmily_HmilySQLUtil_getExactlyNumber_rdh | /**
* Get exactly number value and type.
*
* @param value
* string to be converted
* @param radix
* radix
* @return exactly number value and type
*/
public static Number getExactlyNumber(final String value, final int radix) {try {
return getBigInteger(value, radix);
} catch (final NumberFormatEx... | 3.26 |
hmily_HmilySQLUtil_getExpressionWithoutOutsideParentheses_rdh | /**
* Get exactly SQL expression without outside parentheses.
*
* @param value
* SQL expression
* @return exactly SQL expression
*/
public static String getExpressionWithoutOutsideParentheses(final String value) {
int v1 = getParenthesesOffset(value);
return 0 == v1 ? value : value.substring(v1, value... | 3.26 |
hmily_HmilySQLUtil_getExactlyValue_rdh | /**
* Get exactly value for SQL expression.
*
* <p>remove special char for SQL expression</p>
*
* @param value
* SQL expression
* @return exactly SQL expression
*/
public static String getExactlyValue(final String value) {
return null == value ? null : CharMatcher.anyOf("[]`'\"").removeFrom(value);
} | 3.26 |
hmily_SpringCloudHmilyOrderApplication_main_rdh | /**
* main.
*
* @param args
* args
*/
public static void main(final String[] args) {
SpringApplication.run(SpringCloudHmilyOrderApplication.class, args);
} | 3.26 |
hmily_RpcResource_m0_rdh | /**
* Gets xa proxy.
*
* @return the xa proxy
*/
public RpcXaProxy m0() {
return xaProxy;
} | 3.26 |
hmily_SchemaCache_get_rdh | /**
* acquire Schema with class.
*
* @param clazz
* Class
* @return Schema schema
*/
public Schema<?> get(final Class<?> clazz) {
return get(clazz, cache);
} | 3.26 |
hmily_SchemaCache_getInstance_rdh | /**
* Gets instance.
*
* @return the instance
*/protected static SchemaCache getInstance() {
return SchemaCacheHolder.cache;
} | 3.26 |
hmily_CuratorZookeeperExceptionHandler_handleException_rdh | /**
* Handle exception.
*
* <p>Ignore interrupt and connection invalid exception.</p>
*
* @param cause
* to be handled exception
*/
public static void handleException(final Exception cause) {
if (null == cause) {
return;
}
if (isIgnoredException(cause) || ((null != cause.getCause())
&& ... | 3.26 |
hmily_IndexedBinder_bindIndexed_rdh | /**
* Bind indexed elements to the supplied collection.
*
* @param root
* The name of the property to bind
* @param target
* the target bindable
* @param elementBinder
* the binder to use for elements
* @param aggregateType
* the aggregate type, may be a collection or an array
* @param elementType
*... | 3.26 |
hmily_ConsulPassiveConfig_fileName_rdh | /**
* File name string.
*
* @return the string
*/
public String fileName() {
return (f0 + ".") + fileExtension;
} | 3.26 |
hmily_DatabaseMetaDataDialectHandler_formatTableNamePattern_rdh | /**
* Format table name pattern.
*
* @param tableNamePattern
* table name pattern
* @return formatted table name pattern
*/
default String formatTableNamePattern(final String tableNamePattern) {
return tableNamePattern;} | 3.26 |
hmily_DatabaseMetaDataDialectHandler_getSchema_rdh | /**
* Database meta data dialect handler.
*/public interface DatabaseMetaDataDialectHandler {
/**
* Get schema.
*
* @param connection
* connection
* @return schema
*/
default String getSchema(final Connection connection) {
try {
return connection.getSchema... | 3.26 |
hmily_HmilyTimer_addRemovalListener_rdh | /**
* 增加一个缓存移除的监听器.
*
* @param listener
* 监听器;
*/
public void addRemovalListener(final TimerRemovalListener<V> listener) {
this.timerRemovalListener = listener;
} | 3.26 |
hmily_HmilyTimer_getTime_rdh | /**
* get time.
*
* @return long. time
*/
public Long getTime() {
return time;
} | 3.26 |
hmily_HmilyTimer_getValue_rdh | /**
* get cache value.
*
* @return v. value
*/
public V getValue() {
return value;
} | 3.26 |
hmily_HmilyTimer_put_rdh | /**
* 接收缓存变化值 ,灵活指定过期时间.
*
* @param v
* value
* @param expire
* 过期时间;
* @param unit
* 单位;
* @return Timeout timeout
*/
public Timeout put(final V v, final long expire, final TimeUnit unit) {
Node node = new Node(v, expire, unit);
return timer.newTimeout(node, expire, unit);
} | 3.26 |
hmily_CollectionUtils_create_rdh | /**
* Create collection.
*
* @param <E>
* the type parameter
* @param collectionType
* the collection type
* @param elementType
* the element type
* @param capacity
* the capacity
* @return the collection
... | 3.26 |
hmily_CollectionUtils_isNotEmpty_rdh | /**
* Is not empty boolean.
*
* @param coll
* the coll
* @return the boolean
*/
public static boolean isNotEmpty(final Collection<?> coll) {
return !isEmpty(coll);
} | 3.26 |
hmily_CollectionUtils_isEmpty_rdh | /**
* Is empty boolean.
*
* @param coll
* the coll
* @return the boolean
*/
public static boolean isEmpty(final Collection<?> coll) {
return (coll
== null) || coll.isEmpty();
} | 3.26 |
hmily_CollectionUtils_createMap_rdh | /**
* Create map map.
*
* @param <K>
* the type parameter
* @param <V>
* the type parameter
* @param mapType
* the map type
* @param keyType
* the key type
* @param size
* the size
* @return the map
*/
@SuppressWarnings({ "unchecked", "rawtypes" })
<K, V> Map<K, V> createMap(final Class<?> mapTy... | 3.26 |
hmily_CollectionUtils_asEnumType_rdh | /**
* Cast the given type to a subtype of {@link Enum}.
*
* @param enumType
* the enum type, never {@code null}
* @return the given type as subtype of {@link Enum}
* @throws IllegalArgumentException
* if the given type is not a subtype of {@link Enum}
*/
@SuppressWarnings("rawtypes")
private Class<? extends... | 3.26 |
hmily_HmilyConsistentHashDubboLoadBalance_doSelect_rdh | /**
* The type ConsistenHash Dubbo hmily load balance.
*
* @author xiaoyu(Myth)
*/ public class HmilyConsistentHashDubboLoadBalance extends ConsistentHashLoadBalance {
@Override
protected <T> Invoker<T> doSelect(final List<Invoker<T>> invokers, final URL url, final Invocation invocation) {
Invoker... | 3.26 |
hmily_DelegationThreadPoolExecutor_onInitialRejection_rdh | /**
* On initial rejection.
*
* @param runnable
* the runnable
*/
private void onInitialRejection(final Runnable runnable) {
LOGGER.info("DelegationThreadPoolExecutor:thread {} rejection", runnable);} | 3.26 |
hmily_MetricsReporter_gaugeDecrement_rdh | /**
* Gauge decrement.
*
* @param name
* name
*/public static void gaugeDecrement(final String name) {
gaugeDecrement(name, null);
} | 3.26 |
hmily_MetricsReporter_registerCounter_rdh | /**
* Register counter.
*
* @param name
* name
* @param document
* document for counter
*/
public static void registerCounter(final String name, final String document) {registerCounter(name, null, document);
} | 3.26 |
hmily_MetricsReporter_gaugeIncrement_rdh | /**
* Gauge increment.
*
* @param name
* name
*/
public static void gaugeIncrement(final String name) {
gaugeIncrement(name, null);
} | 3.26 |
hmily_MetricsReporter_m0_rdh | /**
* Register gauge.
*
* @param name
* name
* @param labelNames
* label names
* @param document
* document for gauge
*/
public static void m0(final String name, final String[] labelNames, final String document) {Optional.ofNullable(metricsRegister).ifPresent(register -> register.registerGauge(name, labe... | 3.26 |
hmily_MetricsReporter_counterIncrement_rdh | /**
* Counter increment.
*
* @param name
* name
*/
public static void counterIncrement(final String name) {
counterIncrement(name, null, 1);
} | 3.26 |
hmily_MetricsReporter_recordTime_rdh | /**
* Record time by duration.
*
* @param name
* name
* @param labelValues
* label values
* @param duration
* duration
*/
public static void recordTime(final String name, final String[] labelValues, final long duration) {
Optional.ofNullable(metricsRegister).ifPresent(register -> register.recordTim... | 3.26 |
hmily_MetricsReporter_m1_rdh | /**
* Record time by duration.
*
* @param name
* name
* @param duration
* duration
*/
public static void m1(final String name, final long duration) {
recordTime(name, null, duration);
} | 3.26 |
hmily_MetricsReporter_registerMetrics_rdh | /**
* Register metrics.
*
* @param metrics
* metric collection
*/
public static void registerMetrics(final Collection<Metric> metrics) {
for (Metric metric : metrics) {
switch (metric.getType()) {
case COUNTER :
registerCounter(metric.getName... | 3.26 |
hmily_MetricsReporter_register_rdh | /**
* Register.
*
* @param metricsRegister
* metrics register
*/
public static void register(final MetricsRegister metricsRegister) {
MetricsReporter.metricsRegister = metricsRegister;
} | 3.26 |
hmily_MetricsReporter_registerHistogram_rdh | /**
* Register histogram.
*
* @param name
* name
* @param document
* document for histogram
*/
public static void registerHistogram(final String name, final String document) {registerHistogram(name, null, document);
} | 3.26 |
hmily_MetricsReporter_registerGauge_rdh | /**
* Register gauge.
*
* @param name
* name
* @param document
* document for gauge
*/
public static void registerGauge(final String name, final String document) {
m0(name, null, document);
} | 3.26 |
hmily_HmilyUndoContext_getHmilyLocks_rdh | /**
* Get hmily locks.
*
* @return hmily locks
*/
public Collection<HmilyLock> getHmilyLocks() {
return dataSnapshot.getTuples().stream().map(tuple -> new HmilyLock(transId, participantId, resourceId, tuple.getTableName(), Joiner.on("_").join(tuple.getPrimaryKeyValues()))).collect(Collectors.toList());
} | 3.26 |
hmily_TableMetaDataLoader_load_rdh | /**
* Load table meta data.
*
* @param connectionAdapter
* connection adapter
* @param tableNamePattern
* table name pattern
* @param databaseType
* database type
* @return table meta data
* @throws SQLException
* SQL exception
*/
public static Optional<TableMetaData>
load(final MetaDataConnectionAd... | 3.26 |
hmily_HmilyTacParticipantCoordinator_rollbackParticipant_rdh | /**
* Rollback participant.
*
* @param hmilyParticipantList
* the hmily participant list
* @param selfParticipantId
* the self participant id
*/
public void rollbackParticipant(final List<HmilyParticipant> hmilyParticipantList, final Long
selfParticipantId) {
if (CollectionUtils.isEmpty(hmilyParticipantL... | 3.26 |
hmily_HmilyTacParticipantCoordinator_beginParticipant_rdh | /**
* Begin hmily transaction.
*
* @param context
* the context
* @param point
* the point
* @return the hmily transaction
*/
public HmilyParticipant beginParticipant(final HmilyTransactionContext context, final ProceedingJoinPoint point) {
// 创建全局的事务,创建一个参与者
final HmilyParticipant hmilyParticipan... | 3.26 |
hmily_HmilyTacParticipantCoordinator_commitParticipant_rdh | /**
* Commit participant.
*
* @param hmilyParticipantList
* the hmily participant list
* @param selfParticipantId
* the self participant id
*/
public void commitParticipant(final List<HmilyParticipant> hmilyParticipantList, final Long selfParticipantId) {
if (CollectionUtils.isEmpty(hmilyParticipantList)... | 3.26 |
hmily_HmilyTacParticipantCoordinator_buildHmilyParticipant_rdh | // TODO need review it with rpc.build-participant
private HmilyParticipant buildHmilyParticipant(final ProceedingJoinPoint point, final Long participantId, final Long participantRefId, final Long transId) {HmilyParticipant hmilyParticipant = new HmilyParticipant();
if (null == participantId) {
hmilyPartici... | 3.26 |
hmily_NacosClient_pull_rdh | /**
* Pull input stream.
*
* @param config
* the config
* @return the input stream
*/InputStream pull(final NacosConfig config) {
Properties properties = new Properties();
properties.put(NACOS_SERVER_ADDR_KEY, config.getServer());
try {
configService = NacosFactory.createConfigService(prop... | 3.26 |
hmily_NacosClient_addListener_rdh | /**
* Add listener.
*
* @param context
* the context
* @param passiveHandler
* the passive handler
* @param config
* the config
* @throws NacosException
* the nacos exception
*/
void addListener(final Supplier<ConfigLoader.Context> context, final ConfigLoader.PassiveHandler<NacosPassiveConfig> passiv... | 3.26 |
hmily_Timeout_isDefault_rdh | /**
* 是否为自定义的一个timeout.
*
* @return true or false.
*/
default boolean isDefault() {
return true;
} | 3.26 |
hmily_DubboHmilyOrderApplication_main_rdh | /**
* main.
*
* @param args
* args
*/
public static void main(final String[] args) {
SpringApplication.run(DubboHmilyOrderApplication.class, args);
} | 3.26 |
hmily_HmilyApplicationContextAware_postProcessBeanFactory_rdh | /**
* Fix metric register happen before initialize.
*/
@Override
public void postProcessBeanFactory(@NonNull
final
ConfigurableListableBeanFactory beanFactory) throws BeansException {
HmilyBootstrap.getInstance().start();
} | 3.26 |
hmily_HmilyParen_isLeftParen_rdh | /**
* Judge passed token is left paren or not.
*
* @param token
* token
* @return is left paren or not
*/
public static boolean isLeftParen(final char token) {
return Arrays.stream(values()).anyMatch(each -> each.leftParen == token);
} | 3.26 |
hmily_HmilyParen_match_rdh | /**
* Judge left paren match right paren or not.
*
* @param leftToken
* left token
* @param rightToken
* right token
* @return match or not
*/
public static boolean match(final char leftToken, final char rightToken) {
for (HmilyParen each : HmilyParen.values()) {
if ((each.leftParen == leftTok... | 3.26 |
hmily_DubboRpcXaProxy_getUrl_rdh | /**
* Gets url.
*
* @return the url
*/
public String getUrl() {
return invoker.getUrl().toString();
} | 3.26 |
hmily_ConsulClient_put_rdh | /**
* put config content.
*
* @param key
* config key
* @param content
* config content
*/
public void put(final
String key, final String content) {
f0.keyValueClient().putValue(key, content);
} | 3.26 |
hmily_ConsulClient_addListener_rdh | /**
* Add listener.
*
* @param context
* the context
* @param passiveHandler
* the passive handler
* @param config
* the config
* @throws InterruptedException
* exception
*/
void addListener(final Supplier<ConfigLoader.Context> context, final ConfigLoader.PassiveHandler<ConsulPassiveConfig> passiveHa... | 3.26 |
hmily_ConsulClient_buildHostAndPortList_rdh | /**
* build hostAndPorts.
*
* @param hostAndPorts
* address
* @return HostAndPortList
*/
private static List<HostAndPort> buildHostAndPortList(final String hostAndPorts) {
if (StringUtils.isNoneBlank(hostAndPorts)) {
String[] hostAndPortArray = hostAndPorts.split(",");
List<HostAndPort> host... | 3.26 |
hmily_ConsulClient_getInstance_rdh | /**
* get instance.
*
* @param consulConfig
* consul config
* @return consulClient
*/ public static ConsulClient getInstance(final ConsulConfig consulConfig)
{
String hostAndPorts = consulConfig.getHostAndPorts();
List<HostAndPort> hostAndPortList
= buildHostAndPortList(hostAndPorts);
Consul con... | 3.26 |
hmily_ConsulClient_setConsul_rdh | /**
* set consul.
*
* @param consul
* consul client
*/
public void setConsul(final Consul consul)
{
this.f0 = consul;
} | 3.26 |
hmily_ConsulClient_pull_rdh | /**
* pull.
*
* @param consulConfig
* consul config
* @return InputStream
*/
public InputStream pull(final ConsulConfig consulConfig) {
if (f0 == null) {
if (StringUtils.isNoneBlank(consulConfig.getHostAndPorts())) {
f0 = Consul.builder().withMultipleHostAndPort(buildHostAndPortList(cons... | 3.26 |
hmily_HmilyRepositoryStorage_removeHmilyTransaction_rdh | /**
* Remove hmily transaction.
*
* @param hmilyTransaction
* the hmily transaction
*/
public static void removeHmilyTransaction(final HmilyTransaction hmilyTransaction) {
if (Objects.nonNull(hmilyTransaction)) {
PUBLISHER.asyncPublishEvent(hmilyTransaction, EventTypeEnum.REMOVE_HMILY_TRANSACTION.get... | 3.26 |
hmily_HmilyRepositoryStorage_updateHmilyTransactionStatus_rdh | /**
* Update hmily transaction status.
*
* @param hmilyTransaction
* the hmily transaction
*/
public static void updateHmilyTransactionStatus(final HmilyTransaction hmilyTransaction) {
if (Objects.nonNull(hmilyTransaction)) {
PUBLISHER.publishEvent(hmilyTransaction, EventTypeEnum.UPDATE_HMILY_TRANSAC... | 3.26 |
hmily_HmilyRepositoryStorage_createHmilyTransaction_rdh | /**
* Create hmily transaction.
*
* @param hmilyTransaction
* the hmily transaction
*/
public static void createHmilyTransaction(final HmilyTransaction hmilyTransaction) {
if (Objects.nonNull(hmilyTransaction)) {
PUBLISHER.publishEvent(hmilyTransaction, EventTypeEnum.CREATE_HMILY_TRANSACTION.getCode... | 3.26 |
hmily_HmilyRepositoryStorage_m0_rdh | /**
* Try to write locks.
*
* @param hmilyLocks
* hmily locks
*/
public static void m0(final Collection<HmilyLock> hmilyLocks) {
if (!hmilyLocks.isEmpty()) {
PUBLISHER.syncPublishEvent(hmilyLocks, EventTypeEnum.WRITE_HMILY_LOCKS.getCode());
}
} | 3.26 |
hmily_HmilyRepositoryStorage_removeHmilyParticipant_rdh | /**
* Remove hmily participant.
*
* @param hmilyParticipant
* the hmily participant
*/
public static void removeHmilyParticipant(final HmilyParticipant hmilyParticipant) {
if (Objects.nonNull(hmilyParticipant)) {
PUBLISHER.publishEvent(hmilyParticipant, EventTypeEnum.REMOVE_HMILY_PARTICIPANT.getCode(... | 3.26 |
hmily_HmilyRepositoryStorage_releaseHmilyLocks_rdh | /**
* Release locks..
*
* @param hmilyLocks
* hmily locks
*/public static void releaseHmilyLocks(final Collection<HmilyLock> hmilyLocks) {
if (!hmilyLocks.isEmpty()) {
PUBLISHER.syncPublishEvent(hmilyLocks, EventTypeEnum.RELEASE_HMILY_LOCKS.getCode());
}
} | 3.26 |
hmily_HmilyRepositoryStorage_removeHmilyParticipantUndo_rdh | /**
* Remove hmily participant undo.
*
* @param hmilyParticipantUndo
* the hmily participant undo
*/
public static void removeHmilyParticipantUndo(final HmilyParticipantUndo hmilyParticipantUndo) {if (Objects.nonNull(hmilyParticipantUndo)) {
PUBLISHER.publishEvent(hmilyParticipantUndo, EventTypeEnum.REM... | 3.26 |
hmily_HmilyRepositoryStorage_createHmilyParticipant_rdh | /**
* Create hmily participant.
*
* @param hmilyParticipant
* the hmily participant
*/
public static void createHmilyParticipant(final HmilyParticipant hmilyParticipant) {
if (Objects.nonNull(hmilyParticipant)) {
PUBLISHER.publishEvent(hmilyParticipant, EventTypeEnum.CREAT... | 3.26 |
hmily_HmilyRepositoryStorage_updateHmilyParticipantStatus_rdh | /**
* Update hmily participant status.
*
* @param hmilyParticipant
* the hmily participant
*/
public static void updateHmilyParticipantStatus(final
HmilyParticipant hmilyParticipant) {
if (Objects.nonNull(hmilyParticipant)) {
PUBLISHER.publishEvent(hmilyParticipant, EventTypeEnum.UPDATE_HMILY_PARTI... | 3.26 |
hmily_HmilyRepositoryStorage_createHmilyParticipantUndo_rdh | /**
* Create hmily participant undo.
*
* @param hmilyParticipantUndo
* the hmily participant undo
*/
public static void createHmilyParticipantUndo(final HmilyParticipantUndo hmilyParticipantUndo) {
if (Objects.nonNull(hmilyParticipantUndo)) {
PUBLISHER.publishEvent(hmilyParticipantUndo, EventTypeEnum... | 3.26 |
hmily_HmilyInsertStatement_getInsertColumns_rdh | /**
* Get insert columns segment.
*
* @return insert columns segment
*/
public Optional<HmilyInsertColumnsSegment> getInsertColumns() {
return Optional.ofNullable(insertColumns);
} | 3.26 |
hmily_SingletonHolder_get_rdh | /**
* Get t.
*
* @param <T>
* the type parameter
* @param clazz
* the clazz
* @return the t
*/
@SuppressWarnings("unchecked")
public <T> T get(final Class<T> clazz) {
return ((T) (SINGLES.get(clazz.getName())));
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.