name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
hmily_SingletonHolder_register_rdh
/** * register. * * @param <T> * the type parameter * @param clazz * the clazz * @param o * the o */ public <T> void register(final Class<T> clazz, final Object o) { SINGLES.put(clazz.getName(), o); }
3.26
hmily_NacosPassiveConfig_fileName_rdh
/** * File name string. * * @return the string */ public String fileName() { return (dataId + ".") + fileExtension; }
3.26
hmily_HmilyRepositoryFacade_removeHmilyParticipant_rdh
/** * Remove hmily participant. * * @param participantId * the participant id */ public void removeHmilyParticipant(final Long participantId) { if (hmilyConfig.isPhyDeleted()) { checkRows(hmilyRepository.removeHmilyParticipant(participantId)); } else { updateHmilyParticipantStatus(participantId, Hmily...
3.26
hmily_HmilyRepositoryFacade_findHmilyLockById_rdh
/** * Find hmily lock by id. * * @param lockId * lock id * @return hmily lock */public Optional<HmilyLock> findHmilyLockById(final String lockId) { return hmilyRepository.findHmilyLockById(lockId); }
3.26
hmily_HmilyRepositoryFacade_findHmilyParticipant_rdh
/** * Find hmily participant list. * * @param participantId * the participant id * @return the list */ public List<HmilyParticipant> findHmilyParticipant(final Long participantId) { return hmilyRepository.findHmilyParticipant(participantId); }
3.26
hmily_HmilyRepositoryFacade_releaseHmilyLocks_rdh
/** * Release hmily locks. * * @param locks * locks */ public void releaseHmilyLocks(final Collection<HmilyLock> locks) { checkRows(hmilyRepository.releaseHmilyLocks(locks), locks.size()); }
3.26
hmily_HmilyRepositoryFacade_createHmilyParticipantUndo_rdh
/** * Create hmily participant undo. * * @param undo * the undo */ public void createHmilyParticipantUndo(final HmilyParticipantUndo undo) { checkRows(hmilyRepository.createHmilyParticipantUndo(undo)); }
3.26
hmily_HmilyRepositoryFacade_createHmilyParticipant_rdh
/** * Create hmily participant. * * @param hmilyParticipant * the hmily participant */ public void createHmilyParticipant(final HmilyParticipant hmilyParticipant) { checkRows(hmilyRepository.createHmilyParticipant(hmilyParticipant)); }
3.26
hmily_HmilyRepositoryFacade_removeHmilyParticipantUndo_rdh
/** * Remove hmily participant undo. * * @param undoId * the undo id */ public void removeHmilyParticipantUndo(final Long undoId) { if (hmilyConfig.isPhyDeleted()) { checkRows(hmilyRepository.removeHmilyParticipantUndo(undoId)); } else { updateHmilyParticipantUndoStatus(undoId, HmilyActionEnum.DELETE.getCode());...
3.26
hmily_HmilyRepositoryFacade_updateHmilyParticipantStatus_rdh
/** * Update hmily participant status. * * @param transId * the trans id * @param status * the status */ public void updateHmilyParticipantStatus(final Long transId, final Integer status) { checkRows(hmilyRepository.updateHmilyParticipantStatus(transId, status)); }
3.26
hmily_HmilyRepositoryFacade_removeHmilyTransaction_rdh
/** * Remove hmily transaction. * * @param transId * the trans id */ public void removeHmilyTransaction(final Long transId) { if (hmilyConfig.isPhyDeleted()) { checkRows(hmilyRepository.removeHmilyTransaction(transId)); } else { updateHmilyTransactionStatus(t...
3.26
hmily_HmilyRepositoryFacade_createHmilyTransaction_rdh
/** * Create hmily transaction string. * * @param hmilyTransaction * the hmily transaction */ public void createHmilyTransaction(final HmilyTransaction hmilyTransaction) { checkRows(hmilyRepository.createHmilyTransaction(hmilyTransaction)); }
3.26
hmily_HmilyRepositoryFacade_findUndoByParticipantId_rdh
/** * Find undo by participant id list. * * @param participantId * the participant id * @return the list */ public List<HmilyParticipantUndo> findUndoByParticipantId(final Long participantId) { return hmilyRepository.findHmilyParticipantUndoByParticipantId(participantId); }
3.26
hmily_HmilyRepositoryFacade_updateHmilyTransactionStatus_rdh
/** * Update hmily transaction status int. * * @param transId * the trans id * @param status * the status */ public void updateHmilyTransactionStatus(final Long transId, final Integer status) { checkRows(hmilyRepository.updateHmilyTransactionStatus(transId, status)); }
3.26
hmily_HmilyRepositoryFacade_writeHmilyLocks_rdh
/** * Write hmily locks. * * @param locks * locks */ public void writeHmilyLocks(final Collection<HmilyLock> locks) { int count = hmilyRepository.writeHmilyLocks(locks); if (count != locks.size()) { HmilyLock lock = locks.iterator().next(); throw new HmilyLockConflictException(String.format("current record [%s]...
3.26
hmily_BindData_of_rdh
/** * Of bind data. * * @param <T> * the type parameter * @param type * the type * @param value * the value * @return the bind data */ public static <T> BindData<T> of(final DataType type, final Supplier<T> value) { return new BindData<>(type, value); }
3.26
hmily_BindData_withValue_rdh
/** * With value bind data. * * @param <T> * the type parameter * @param value * the value * @return the bind data */ public <T> BindData<T> withValue(final Supplier<T> value) { return new BindData<>(this.type, value); }
3.26
hmily_HmilyRepositoryEventDispatcher_doDispatch_rdh
/** * Do event dispatch. * * @param event * the event */ public void doDispatch(final HmilyRepositoryEvent event) { EventTypeEnum eventTypeEnum = EventTypeEnum.buildByCode(event.getType()); HmilyTransaction hmilyTransaction = event.getHmilyTransaction(); HmilyParti...
3.26
hmily_TransactionContext_getCoordinator_rdh
/** * Gets coordinator. * * @return the coordinator */ public Coordinator getCoordinator() { return coordinator; }
3.26
hmily_TransactionContext_setCoordinator_rdh
/** * Sets coordinator. * * @param coordinator * the coordinator */ public void setCoordinator(final Coordinator coordinator) { this.coordinator = coordinator; }
3.26
hmily_TransactionContext_setOneFinally_rdh
/** * Sets one finally. * * @param oneFinally * the one finally */ public void setOneFinally(final Finally oneFinally) {this.oneFinally = oneFinally; }
3.26
hmily_OrderServiceImpl_mockInventoryWithConfirmTimeout_rdh
/** * 模拟在订单支付操作中,库存在Confirm阶段中的timeout * * @param count * 购买数量 * @param amount * 支付金额 * @return string */ @Override public String mockInventoryWithConfirmTimeout(Integer count, BigDecimal amount) { Order order = saveOrder(count, amount); paymentService.mockPaymentInventoryWithConfirmTimeout(order); return "...
3.26
hmily_OrderServiceImpl_mockInventoryWithTryTimeout_rdh
/** * 模拟在订单支付操作中,库存在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.26
hmily_GrpcInvokeContext_getArgs_rdh
/** * get args. * * @return args args */ public Object[] getArgs() { return f0;}
3.26
hmily_GrpcInvokeContext_setArgs_rdh
/** * set args. * * @param args * args */ public void setArgs(final Object[] args) { this.f0 = args; }
3.26
hmily_DataSourceMetaDataLoader_load_rdh
/** * Load data source meta data. * * @param dataSource * data source * @param databaseType * database type * @return datasource metadata * @throws SQLException * SQL exception */ public static DataSourceMetaData load(final DataSource dataSource, final DatabaseType databaseType) throws SQLException { ...
3.26
hmily_DeleteStatementAssembler_assembleHmilyDeleteStatement_rdh
/** * Assemble Hmily delete statement. * * @param deleteStatement * delete statement * @param hmilyDeleteStatement * hmily delete statement * @return hmily delete statement */ public static HmilyDeleteStatement assembleHmilyDeleteStatement(final DeleteStatement deleteStatement, final HmilyDeleteStatement hm...
3.26
hmily_FileUtils_readYAML_rdh
/** * Read yaml string. * * @param yamlFile * the yaml file * @return the string */ @SneakyThrows public static String readYAML(final String yamlFile) {return Files.readAllLines(Paths.get(ClassLoader.getSystemResource(yamlFile).toURI())).stream().filter(each -> !each.startsWith("#")).map(each -> each + System.l...
3.26
hmily_FileUtils_writeFile_rdh
/** * Write file. * * @param fullFileName * the full file name * @param contents * the contents */ public static void writeFile(final String fullFileName, final byte[] contents) { try { RandomAccessFile raf = new RandomAccessFile(fullFileName, "rw");try (FileChannel channel = raf.getChannel()) ...
3.26
hmily_MongoEntityConvert_convert_rdh
/** * 转换mongo对象. * * @param entity * mongo entity. * @return hmily entity. */ public HmilyParticipantUndo convert(final UndoMongoEntity entity) { HmilyParticipantUndo undo = new HmilyParticipantUndo(); undo.setUndoId(entity.getUndoId()); undo.setParticipantId(entity.getParticipantId());undo.setTransId(entity.ge...
3.26
hmily_MongoEntityConvert_m0_rdh
/** * 转换mongo对象. * * @param entity * mongo entity. * @return hmily entity. */ public HmilyLock m0(final LockMongoEntity entity) { return new HmilyLock(entity.getTransId(), entity.getParticipantId(), entity.getResourceId(), entity.getTargetTableName(), entity.getTargetTablePk()); }
3.26
hmily_MongoEntityConvert_create_rdh
/** * 转换mongo对象. * * @param lock * hmily entity. * @return mongo entity. */ public LockMongoEntity create(final HmilyLock lock) { LockMongoEntity entity = new LockMongoEntity(); entity.setLockId(lock.getLockId()); entity.setTargetTableName(lock.getTargetTableName()); entity.setTargetTablePk(lock.getTargetTableP...
3.26
hmily_SofaHmilyOrderApplication_main_rdh
/** * main. * * @param args * args. */ public static void main(final String[] args) { SpringApplication springApplication = new SpringApplication(SofaHmilyOrderApplication.class); springApplication.run(args); }
3.26
hmily_HmilyXaResource_prepare_rdh
/** * Prepare int. * * @return the int * @throws XAException * the xa exception */ public int prepare() throws XAException { return this.prepare(this.xid); }
3.26
hmily_HmilyXaResource_forget_rdh
/** * Forget. * * @throws XAException * the xa exception */ public void forget() throws XAException { this.forget(this.xid); }
3.26
hmily_HmilyXaResource_rollback_rdh
/** * Rollback. * * @throws XAException * the xa exception */ public void rollback() throws XAException { this.rollback(this.xid); }
3.26
hmily_HmilyXaResource_start_rdh
/** * Start. * * @param i * the * @throws XAException * the xa exception */ public void start(final int i) throws XAException { this.start(this.xid, i); }
3.26
hmily_HmilyXaResource_commit_rdh
/** * Commit. * * @param b * the b * @throws XAException * the xa exception */ public void commit(final boolean b) throws XAException { this.commit(this.xid, b); }
3.26
hmily_HmilyXaResource_getXaResource_rdh
/** * Gets xa resource. * * @return the xa resource */ public XAResource getXaResource() { return xaResource; }
3.26
hmily_HmilyXaP6Datasource_m0_rdh
/** * Gets hmily connection. * * @param xaConnection * the connection * @return the hmily connection */ private Connection m0(final XAConnection xaConnection) throws SQLException { return new HmilyXaConnection(xaConnection); }
3.26
hmily_EtcdPassiveConfig_fileName_rdh
/** * File name string. * * @return the string */ public String fileName() { return (key + ".") + fileExtension; }
3.26
hmily_ZkPassiveConfig_fileName_rdh
/** * File name string. * * @return the string */ public String fileName() { return (path + ".") + fileExtension;}
3.26
hmily_HmilyHashLoadBalance_select_rdh
/** * Use load balancing to select invoker. * * @param invocation * invocation * @return Invoker * @throws NoInvokerException * NoInvokerException */ public Invoker<T> select(final InvokeContext invocation) throws NoInvokerException { long hash = Math.abs(StringUtils.convertLong(invocation.getAttachment(Con...
3.26
hmily_HmilyHashLoadBalance_refresh_rdh
/** * Refresh local invoker. * * @param invokers * invokers */ @Override public void refresh(final Collection<Invoker<T>> invokers) { LOGGER.info("{} try to refresh RoundRobinLoadBalance's invoker cache, size= {} ", config.getSimpleObjectName(), CollectionUtils.isEmpty(invokers) ? 0 : invokers.size()); i...
3.26
hmily_HmilyTacTransactionManager_commit_rdh
/** * Commit. * * @param currentTransaction * the current transaction */ public void commit(final HmilyTransaction currentTransaction) { log.debug("TAC-tm-commit ::: {}", currentTransaction); if (Objects.isNull(currentTransaction)) { return; } List<HmilyParticipant> hmilyParticipants = c...
3.26
hmily_HmilyTacTransactionManager_rollback_rdh
/** * Rollback. * * @param currentTransaction * the current transaction */ public void rollback(final HmilyTransaction currentTransaction) { if (Objects.isNull(currentTransaction)) { return; } log.debug("TAC-tm-rollback ::: {}", currentTransaction); List<HmilyParticipant> hmilyParticipant...
3.26
hmily_HmilyTacTransactionManager_begin_rdh
/** * Begin hmily transaction. * * @param point * proceeding join point * @return the hmily transaction */ public HmilyTransaction begin(final ProceedingJoinPoint point) { // 创建全局的事务,创建一个参与者 HmilyTransaction globalHmilyTransaction = createHmilyTransaction(); HmilyRepositoryStorage.createHmilyTransac...
3.26
hmily_HmilyTacTransactionManager_getInstance_rdh
/** * Gets instance. * * @return the instance */ public static HmilyTacTransactionManager getInstance() { return INSTANCE; }
3.26
hmily_HmilySQLComputeUtils_getAllColumns_rdh
/** * Get all columns. * * @param segment * hmily simple table segment * @param tableName * table name * @return all table columns in asterisk way */ public static String getAllColumns(final HmilySimpleTableSegment segment, final String tableName) { String result; if (segment.getAlias().isPresent()) { ...
3.26
hmily_HmilySQLComputeUtils_getAllPKColumns_rdh
/** * Get all pk columns. * * @param segment * hmily simple table segment * @param tableName * table name * @param primaryKeyColumns * primary key columns * @return all table primary key columns in asterisk way */ public static String getAllPKColumns(final HmilySimpleTableSegment segment, final String...
3.26
hmily_HmilyTransaction_registerParticipantList_rdh
/** * Register participant list. * * @param hmilyParticipantList * the hmily participant list */ public void registerParticipantList(final List<HmilyParticipant> hmilyParticipantList) { hmilyParticipants.addAll(hmilyParticipantList); }
3.26
hmily_HmilyTransaction_registerParticipant_rdh
/** * registerParticipant. * * @param hmilyParticipant * {@linkplain HmilyParticipant} */ public void registerParticipant(final HmilyParticipant hmilyParticipant) {if (Objects.nonNull(hmilyParticipant)) { hmilyParticipants.add(hmilyParticipant); } }
3.26
hmily_DisruptorProvider_onData_rdh
/** * push data to disruptor queue. * * @param t * the t */ public void onData(final T t) { long v0 = ringBuffer.next(); try { DataEvent<T> de = ringBuffer.get(v0); de.setT(t); ringBuffer.publish(v0); } catch (Exception ex) { logger.error("push data error:", ex); }...
3.26
hmily_HmilyExecuteTemplate_rollback_rdh
/** * Rollback. * * @param connection * connection */ public void rollback(final Connection connection) { if (check()) { return; } List<HmilyUndoContext> contexts = HmilyUndoContextCacheManager.INSTANCE.get(); List<HmilyLock> locks = new LinkedList<>(); for (HmilyUndoContext context...
3.26
hmily_HmilyExecuteTemplate_commit_rdh
/** * Commit. * * @param connection * the connection */ public void commit(final Connection connection) { if (check()) { return; } List<HmilyParticipantUndo> undoList = buildUndoList(); for (HmilyParticipantUndo undo : undoList) { HmilyParticipantUndoCacheManager.getInstance(...
3.26
hmily_HmilyExecuteTemplate_execute_rdh
/** * Execute. * * @param sql * SQL * @param parameters * parameters * @param connectionInformation * connection information */ public void execute(final String sql, final List<Object> parameters, final ConnectionInformation connectionInformation) { if (check()) { return; } HmilyStat...
3.26
hmily_HmilyExecuteTemplate_beforeSetAutoCommit_rdh
/** * Sets auto commit. * * @param connection * the connection */ public void beforeSetAutoCommit(final Connection connection) { if (check()) { return; }try { boolean autoCommit = connection.getAutoCommit(); if (autoCommit) { connection.setAutoCommit(false); ...
3.26
hmily_ColumnMetaDataLoader_load_rdh
/** * Load column meta data list. * * @param connection * connection * @param tableNamePattern * table name pattern * @param databaseType * database type * @return column meta data list * @throws SQLException * SQL exception */ public static Collection<ColumnMetaData> load(final Connection connect...
3.26
hmily_PropertyName_getInvalidChars_rdh
/** * Gets invalid chars. * * @param elementValue * the element value * @return the invalid chars */ static List<Character> getInvalidChars(final CharSequence elementValue) { List<Character> chars = new ArrayList<>(); for (int i = 0; i < elementValue.length(); i++) { char ch = elementValue.char...
3.26
hmily_PropertyName_isLastElementIndexed_rdh
/** * 是否为最后一个元素. * * @return boolean. boolean */ public boolean isLastElementIndexed() { int elementSize = getElementSize(); return (elementSize > 0) && m0(this.getElements()[elementSize - 1]); }
3.26
hmily_PropertyName_getLastElement_rdh
/** * Gets last element. * * @return the last element */ public String getLastElement() { int elementSize = getElementSize(); return elementSize != 0 ? getElement(elementSize - 1) : ""; }
3.26
hmily_PropertyName_isValidElement_rdh
/** * Is valid element boolean. * * @param elementValue * the element value * @return the boolean */ static boolean isValidElement(final CharSequence elementValue) { for (int i = 0; i < elementValue.length(); i++) { char ch = elementValue.charAt(i); if (!isValidChar(ch, i)) { ret...
3.26
hmily_PropertyName_chop_rdh
/** * Return a new {@link PropertyName} by chopping this name to the given * {@code size}. For example, {@code chop(1)} on the name {@code foo.bar} will return * {@code foo}. * * @param size * the size to chop * @return the chopped name */ public PropertyName chop(final int size) { if (size >= getElementS...
3.26
hmily_PropertyName_isValidChar_rdh
/** * Is valid char boolean. * * @param ch * the ch * @param index * the index * @return the boolean */ static boolean isValidChar(final char ch, final int index) { return (isAlpha(ch) || isNumeric(ch)) || ((index != 0) && (ch == '-')); }
3.26
hmily_PropertyName_getElementSize_rdh
/** * Gets element size. * * @return the element size */public int getElementSize() { return this.elements.length; }
3.26
hmily_PropertyName_getElement_rdh
/** * Gets element. * * @param index * the index * @return the element */ public String getElement(final int index) { return getElements()[index]; }
3.26
hmily_PropertyName_isIndexed_rdh
/** * Whether the parameter of the index type list array. */ private boolean isIndexed(final int index) { String element = getElement(index); return m0(element); }
3.26
hmily_PropertyName_append_rdh
/** * Append property name. * * @param elementValue * the element value * @return the property name */ public PropertyName append(final String elementValue) { if (elementValue == null) { return this; } process(elementValue, (e, indexed) -> { if (StringUtils.isBlank(e.get()) && LOGGER...
3.26
hmily_PropertyName_isNumericIndex_rdh
/** * Return if the element in the name is indexed and numeric. * * @param elementIndex * the index of the element * @return {@code true} if the element is indexed and numeric */ public boolean isNumericIndex(final int elementIndex) { return isIndexed(elementIndex) && isNumeric(getElement(elementIndex)); }
3.26
hmily_PropertyName_of_rdh
/** * property key 转换为一个PropertyName对象. * * @param name * name; * @return this property name */ public static PropertyName of(final String name) { return Optional.ofNullable(name).filter(n -> n.length() > 1).filter(n -> (n.charAt(0) != NAME_JOIN) && (n.charAt(n.length() - 1) != NAME_JOIN)).map(n -> ...
3.26
hmily_PropertyName_m0_rdh
/** * Whether the parameter of the index type list array. */private static boolean m0(final CharSequence element) { return (element.charAt(0) == '[') && possibleIsIndexed(element); }
3.26
hmily_PropertyName_isEmpty_rdh
/** * Is empty boolean. * * @return the boolean */ public boolean isEmpty() { return this.getElementSize() == 0;}
3.26
hmily_PropertyName_isAncestorOf_rdh
/** * Determine if the node name of the pointing is a parent. If yes, return true. * * @param name * name. * @return boolean boolean */ public boolean isAncestorOf(final PropertyName name) { if (this.getElements().length >= name.getElements().length) { return false; } for (int v11 = 0; v11...
3.26
hmily_HmilyLock_getLockId_rdh
/** * Get lock id. * * @return lock id */ public String getLockId() { return Joiner.on(";;").join(resourceId, targetTableName, targetTablePk); }
3.26
hmily_HmilyReflector_executor_rdh
/** * 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 executorTyp...
3.26
hmily_ReflectObject_provide_rdh
/** * The type Reflect object. * * @author xiaoyu */public class ReflectObject implements ObjectProvide { @Override @SneakyThrows public Object provide(final Class<?> clazz) { return clazz.newInstance(); }
3.26
hmily_HmilyFeignConfiguration_hmilyFeignInterceptor_rdh
/** * The type Hmily spring cloud configuration. * * @author xiaoyu(Myth) */ @Configurationpublic class HmilyFeignConfiguration { /** * Hmily rest template interceptor request interceptor. * * @return the request interceptor */ @Bean @Qualifier("hmilyFeignInterceptor") public Req...
3.26
hmily_HmilyFeignConfiguration_hmilyHystrixConcurrencyStrategy_rdh
/** * Hystrix concurrency strategy hystrix concurrency strategy. * * @return the hystrix concurrency strategy */ @Bean @ConditionalOnProperty(name = "feign.hystrix.enabled") public HystrixConcurrencyStrategy hmilyHystrixConcurrencyStrategy() { return new HmilyHystrixConcurrencyStrategy(); }
3.26
hmily_AutoCommitThreadLocal_remove_rdh
/** * Remove. */ public void remove() { CURRENT_LOCAL.remove(); }
3.26
hmily_AutoCommitThreadLocal_set_rdh
/** * Set. * * @param oldAutoCommit * the old auto commit */ public void set(final boolean oldAutoCommit) {CURRENT_LOCAL.set(oldAutoCommit); }
3.26
hmily_ZookeeperRepository_nextPath_rdh
/** * Next path string. * * @return the string */ public String nextPath() { path = (path + "/") + f0[index]; index++; return path; }
3.26
hmily_ZookeeperRepository_hasNext_rdh
/** * Has next boolean. * * @return the boolean */public boolean hasNext() { return index < f0.length; }
3.26
hmily_XaState_valueOf_rdh
/** * Value of xa state. * * @param state * the state * @return the xa state */ public static XaState valueOf(final int state) { return Arrays.stream(XaState.values()).filter(e -> e.getState() == state).findFirst().orElse(STATUS_UNKNOWN); }
3.26
hmily_HmilyPostgreSQLInsertStatement_getWithSegment_rdh
/** * Get with segment. * * @return with segment. */ public Optional<HmilyWithSegment> getWithSegment() { return Optional.ofNullable(withSegment); }
3.26
hmily_ConsistentHashSelector_md5_rdh
/** * Md 5 byte [ ]. * * @param value * the value * @return the byte [ ] */ private byte[] md5(final String value) { MessageDigest md5; try { md5 = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new IllegalStateException(e.getMessage(), e); } m...
3.26
hmily_ConsistentHashSelector_selectForKey_rdh
/** * Select for key singleton executor. * * @param hash * the hash * @return the singleton executor */ private SingletonExecutor selectForKey(final long hash) { SingletonExecutor invoker; Long key = hash; if (!virtualInvokers.containsKey(key)) { SortedMap<Long, SingletonExecutor> tailMap =...
3.26
hmily_ConsistentHashSelector_hash_rdh
/** * Ketama is a hash algorithm. * * @param digest * digest; * @param number * numerical; * @return hash value ; */ private long hash(final byte[] digest, final int number) { return ((((((long) (digest[3 + (number * 4)] & 0xff)) << 24) | (((long) (digest[2 + (number * 4)] & 0xff)) << 16)) | ...
3.26
hmily_ConsistentHashSelector_select_rdh
/** * Select singleton executor. * * @param key * the key * @return the singleton executor */ public SingletonExecutor select(final String key) { byte[] digest = md5(key); return selectForKey(hash(digest, 0)); }
3.26
hmily_GrpcHmilyContext_getHmilyClass_rdh
/** * get hmilyClass conext. * * @return ThreadLocal */ public static ThreadLocal<GrpcInvokeContext> getHmilyClass() { return hmilyClass; }
3.26
hmily_GrpcHmilyContext_removeAfterInvoke_rdh
/** * remove hmily conext after invoke. */ public static void removeAfterInvoke() { GrpcHmilyContext.getHmilyClass().remove(); }
3.26
hmily_HmilyExpressionBuilder_extractAndPredicates_rdh
/** * Extract and predicates. * * @return Or predicate segment. */ public HmilyOrPredicateSegment extractAndPredicates() { HmilyOrPredicateSegment result = new HmilyOrPredicateSegment(); if (expression instanceof HmilyBinaryOperationExpression) { String operator =...
3.26
hmily_MotanServerConfig_baseServiceConfig_rdh
/** * Base service config basic service config bean. * * @return the basic service config bean */ @Bean @ConfigurationProperties(prefix = "hmily.motan.server") public BasicServiceConfigBean baseServiceConfig() { return new BasicServiceConfigBean(); }
3.26
hmily_PropertyKey_isAvailable_rdh
/** * Is available boolean. * * @param name * the name * @return the boolean */public boolean isAvailable(final PropertyName name) { return propertyName.equals(name); }
3.26
hmily_ConfigLoaderServer_load_rdh
/** * Load config. */ public static void load() { // Start processing the associated parameters. ConfigScan.scan(); ServerConfigLoader loader = new ServerConfigLoader(); loader.load(ConfigLoader.Context::new, (context, config) -> { if (config != null) { if (StringUtils.isNotBlank(c...
3.26
hmily_SerializeEnum_acquire_rdh
/** * Acquire serialize protocol serialize protocol enum. * * @param serialize * the serialize protocol * @return the serialize protocol enum */ public static SerializeEnum acquire(final String serialize) { Optional<SerializeEnum> serializeEnum = Arrays.stream(SerializeEnum.values()).filter(v -> Objects.equ...
3.26
hmily_HmilyDeleteStatement_getWhere_rdh
/** * Get where. * * @return where segment */ public Optional<HmilyWhereSegment> getWhere() { return Optional.ofNullable(where); }
3.26
hmily_PropertyKeyParse_isFrom_rdh
/** * Is from boolean. * * @param from * the from * @return the boolean */ boolean isFrom(final T from) { return Objects.equals(from, this.from); }
3.26
hmily_PropertyKeyParse_parse_rdh
/** * Parse property key [ ]. * * @param propertyName * the property name * @return the property key [ ] */ public PropertyKey[] parse(final String propertyName) { // Use a local copy in case another thread changes things LastKey<String> last = this.lastKeyStr; if ((last != null) && last.isFrom(prop...
3.26
hmily_SpringCloudXaAutoConfiguration_hmilyXaPostProcessor_rdh
/** * Register {@link FeignBeanPostProcessor} Bean. * * @return {@link FeignBeanPostProcessor} Bean */ @Bean public static FeignBeanPostProcessor hmilyXaPostProcessor() { return new FeignBeanPostProcessor(); }
3.26
hmily_GrpcHmilyConfiguration_grpcHmilyClient_rdh
/** * add grpcHmilyClient. * * @return grpcHmilyClient */ @Bean public GrpcHmilyClient grpcHmilyClient() { return new GrpcHmilyClient(); }
3.26