name
stringlengths
12
178
code_snippet
stringlengths
8
36.5k
score
float64
3.26
3.68
dubbo_ReflectUtils_isInstance_rdh
/** * Check if one object is the implementation for a given interface. * <p> * This method will not trigger classloading for the given interface, therefore it will not lead to error when * the given interface is not visible by the classloader * * @param obj * Object to examine * @param interfaceClazzName * ...
3.26
dubbo_ReflectUtils_findHierarchicalTypes_rdh
/** * Find the hierarchical types from the source {@link Class class} by specified {@link Class type}. * * @param sourceClass * the source {@link Class class} * @param matchType * the type to match * @param <T> * the type to match * @return non-null read-only {@link Set} * @since 2.7.5 */ public stati...
3.26
dubbo_ReflectUtils_makeAccessible_rdh
/** * Copy from org.springframework.util.ReflectionUtils. * Make the given method accessible, explicitly setting it accessible if * necessary. The {@code setAccessible(true)} method is only called * when actually necessary, to avoid unnecessary conflicts with a JVM * SecurityManager (if active). * * @param metho...
3.26
dubbo_ReflectUtils_getDesc_rdh
/** * get constructor desc. * "()V", "(Ljava/lang/String;I)V" * * @param c * constructor. * @return desc */ public static String getDesc(final CtConstructor c) throws NotFoundException { StringBuilder ret = new StringBuilder("("); CtClass[] parameterTypes = c.getParameterTypes(); for (int i =...
3.26
dubbo_ReflectUtils_name2desc_rdh
/** * name to desc. * java.util.Map[][] => "[[Ljava/util/Map;" * * @param name * name. * @return desc. */ public static String name2desc(String name) { StringBuilder v45 = new StringBuilder(); int c = 0; int index = name.indexOf('['); if (index > 0) { c = (name.length() - index) / 2; ...
3.26
dubbo_ReflectUtils_getDescWithoutMethodName_rdh
/** * get method desc. * "(I)I", "()V", "(Ljava/lang/String;Z)V". * * @param m * method. * @return desc. */ public static String getDescWithoutMethodName(final CtMethod m) throws NotFoundException { StringBuilder ret = new StringBuilder(); ret.append('('); CtClass[] parameterTypes = m.getParameter...
3.26
dubbo_ReflectUtils_findParameterizedTypes_rdh
/** * Find the {@link Set} of {@link ParameterizedType} * * @param sourceClass * the source {@link Class class} * @return non-null read-only {@link Set} * @since 2.7.5 */ public static Set<ParameterizedType> findParameterizedTypes(Class<?> sourceClass) { // Add Generic Interfaces List<Type> genericType...
3.26
dubbo_ReflectUtils_desc2name_rdh
/** * desc to name. * "[[I" => "int[][]" * * @param desc * desc. * @return name. */ public static String desc2name(String desc) { StringBuilder sb = new StringBuilder(); int c = desc.lastIndexOf('[') + 1; if (desc.length() == (c + 1)) { switch (desc.charAt(c)) { case JVM_VOID : ...
3.26
dubbo_ReflectUtils_name2class_rdh
/** * name to class. * "boolean" => boolean.class * "java.util.Map[][]" => java.util.Map[][].class * * @param cl * ClassLoader instance. * @param name * name. * @return Class instance. */ private static Class<?> name2class(ClassLoader cl, String name) throws ClassNotFoundException { int c = 0; i...
3.26
dubbo_ReflectUtils_getAllFieldNames_rdh
/** * Get all field names of target type * * @param type * @return */ public static Set<String> getAllFieldNames(Class<?> type) {Set<String> fieldNames = new HashSet<>(); for (Field field : type.getDeclaredFields()) { fieldNames.add(field.getName()); } Set<Class<?>> allSuperClasses = ClassUtil...
3.26
dubbo_ReflectUtils_hasMethod_rdh
/** * Check target bean class whether has specify method * * @param beanClass * @param methodName * @return */ public static boolean hasMethod(Class<?> beanClass, String methodName) { try { BeanInfo beanInfo = Introspector.getBeanInfo(beanClass); Optional<MethodDescriptor> descriptor =...
3.26
dubbo_ReflectUtils_m0_rdh
/** * get name. * java.lang.Object[][].class => "java.lang.Object[][]" * * @param c * class. * @return name. */ public static String m0(Class<?> c) { if (c.isArray()) { StringBuilder sb = new StringBuilder(); do { sb.append("[]"); c = c.getComponentType(); } ...
3.26
dubbo_ReflectUtils_desc2class_rdh
/** * desc to class. * "[Z" => boolean[].class * "[[Ljava/util/Map;" => java.util.Map[][].class * * @param cl * ClassLoader instance. * @param desc * desc. * @return Class instance. * @throws ClassNotFoundException */ private static Class<?> desc2class(ClassLoader cl, String desc) throws ClassNotFoundEx...
3.26
dubbo_ReflectUtils_desc2classArray_rdh
/** * get class array instance. * * @param cl * ClassLoader instance. * @param desc * desc. * @return Class[] class array. * @throws ClassNotFoundException */ private static Class<?>[] desc2classArray(ClassLoader cl, String desc) throws ClassNotFoundException { if (desc.length() == 0) { return ...
3.26
dubbo_ReflectUtils_findMethodByMethodSignature_rdh
/** * Find method from method signature * * @param clazz * Target class to find method * @param methodName * Method signature, e.g.: method1(int, String). It is allowed to provide method name only, e.g.: method2 *...
3.26
dubbo_ReflectUtils_getName_rdh
/** * get method name. * "void do(int)", "void do()", "int do(java.lang.String,boolean)" * * @param m * method. * @return name. */ public static String getName(final Method m) { StringBuilder ret = new StringBuilder(); ret.append(m0(m.getReturnType())).append(' '); ret.append(m.getName()).append('(...
3.26
dubbo_AbstractConfigurator_isV27ConditionMatchOrUnset_rdh
/** * Check if v2.7 configurator rule is set and can be matched. * * @param url * the configurator rule url * @return true if v2.7 configurator rule is not set or the rule can be matched. */ private boolean isV27ConditionMatchOrUnset(URL url) { String providers = configuratorUrl.getParameter(OVERRIDE_PR...
3.26
dubbo_DefaultApplicationDeployer_start_rdh
/** * Start the bootstrap * * @return */ @Overridepublic Future start() { synchronized(startLock) {if ((isStopping() || isStopped()) || isFailed()) { throw new IllegalStateException(getIdentifier() + " is stopping or stopped, can not start again"); } try { // maybe cal...
3.26
dubbo_DefaultApplicationDeployer_supportsExtension_rdh
/** * Supports the extension with the specified class and name * * @param extensionClass * the {@link Class} of extension * @param name * the name of extension * @return if supports, return <code>true</code>, or <code>false</code> * @since 2.7.8 */ private boolean supportsExtension(Class<?> extensionClass,...
3.26
dubbo_DefaultApplicationDeployer_isRegisterConsumerInstance_rdh
/** * Close registration of instance for pure Consumer process by setting registerConsumer to 'false' * by default is true. */ private boolean isRegisterConsumerInstance() { Boolean registerConsumer = getApplication().getRegisterConsumer(); if (registerConsumer == null) { return true; } return Boolea...
3.26
dubbo_DefaultApplicationDeployer_useRegistryAsConfigCenterIfNecessary_rdh
/** * For compatibility purpose, use registry as the default config center when * there's no config center specified explicitly and * useAsConfigCenter of registryConfig is null or true */ private void useRegistryAsConfigCenterIfNecessary() { // we use the loading status of DynamicConfiguration to decide whethe...
3.26
dubbo_DefaultApplicationDeployer_getDynamicConfiguration_rdh
/** * Get the instance of {@link DynamicConfiguration} by the specified connection {@link URL} of config-center * * @param connectionURL * of config-center * @return non-null * @since 2.7.5 */ private DynamicConfiguration getDynamicConfiguration(URL connectionURL) { String protocol = connectionURL.getProtocol(...
3.26
dubbo_DefaultApplicationDeployer_isUsedRegistryAsCenter_rdh
/** * Is used the specified registry as a center infrastructure * * @param registryConfig * the {@link RegistryConfig} * @param usedRegistryAsCenter * the configured value on * @param centerType * the type name of center * @p...
3.26
dubbo_AbstractDynamicConfiguration_getGroup_rdh
/** * Get the group from {@link URL the specified connection URL} * * @param url * {@link URL the specified connection URL} * @return non-null * @since 2.7.8 */ protected static String getGroup(URL url) { String group = getParameter(url, GROUP_PARAM_NAME, null); return StringUtils.isBlank(group) ? ge...
3.26
dubbo_AbstractDynamicConfiguration_m0_rdh
/** * Executes the {@link Callable} with the specified timeout * * @param task * the {@link Callable task} * @param timeout * timeout in milliseconds * @param <V> * the type of computing result * @return the computing result */ protected final <V> V m0(Callable<V> task, long timeout) { V value = nu...
3.26
dubbo_AbstractDynamicConfiguration_getDefaultTimeout_rdh
/** * * @return the default timeout * @since 2.7.8 */@Override public long getDefaultTimeout() {return getTimeout(); }
3.26
dubbo_AbstractDynamicConfiguration_execute_rdh
/** * Executes the {@link Runnable} with the specified timeout * * @param task * the {@link Runnable task} * @param timeout * timeout in milliseconds */protected final void execute(Runnable task, long timeout) { m0(() -> { task.run(); return null; }, timeout); }
3.26
dubbo_AbstractDynamicConfiguration_getDefaultGroup_rdh
/** * * @return the default group * @since 2.7.8 */@Override public String getDefaultGroup() { return getGroup(); }
3.26
dubbo_RpcStatus_getStatus_rdh
/** * * @param url * @param methodName * @return status */ public static RpcStatus getStatus(URL url, String methodName) { String uri = url.toIdentityString(); ConcurrentMap<String, RpcStatus> map = ConcurrentHashMapUtils.computeIfAbsent(METHOD_STATISTICS, uri, k -> new ConcurrentHashMap<>()); return...
3.26
dubbo_RpcStatus_getTotalElapsed_rdh
/** * get total elapsed. * * @return total elapsed */public long getTotalElapsed() { return totalElapsed.get(); }
3.26
dubbo_RpcStatus_removeStatus_rdh
/** * * @param url */ public static void removeStatus(URL url, String methodName) { String uri = url.toIdentityString(); ConcurrentMap<String, RpcStatus> map = METHOD_STATISTICS.get(uri); if (map != null) { map.remove(methodName);} }
3.26
dubbo_RpcStatus_getFailed_rdh
/** * get failed. * * @return failed */ public int getFailed() { return failed.get(); }
3.26
dubbo_RpcStatus_get_rdh
/** * get value. * * @param key * @return value */ public Object get(String key) { return values.get(key); }
3.26
dubbo_RpcStatus_getSucceededAverageElapsed_rdh
/** * get succeeded average elapsed. * * @return succeeded average elapsed */ public long getSucceededAverageElapsed() { long succeeded = getSucceeded(); if (succeeded == 0) { return 0; } return getSucceededElapsed() / succeeded; }
3.26
dubbo_RpcStatus_getFailedMaxElapsed_rdh
/** * get failed max elapsed. * * @return failed max elapsed */ public long getFailedMaxElapsed() { return failedMaxElapsed.get(); }
3.26
dubbo_RpcStatus_m0_rdh
/** * * @param url * @param elapsed * @param succeeded */ public static void m0(URL url, String methodName, long elapsed, boolean succeeded) { endCount(getStatus(url), elapsed, succeeded); endCount(getStatus(url, methodName), elapsed, succeeded); }
3.26
dubbo_RpcStatus_getSucceededMaxElapsed_rdh
/** * get succeeded max elapsed. * * @return succeeded max elapsed. */ public long getSucceededMaxElapsed() { return succeededMaxElapsed.get(); }
3.26
dubbo_RpcStatus_getSucceeded_rdh
/** * get succeeded. * * @return succeeded */public long getSucceeded() { return getTotal() - getFailed(); }
3.26
dubbo_RpcStatus_m1_rdh
/** * Calculate average TPS (Transaction per second). * * @return tps */ public long m1() { if (getTotalElapsed() >= 1000L) { return getTotal() / (getTotalElapsed() / 1000L); } return getTotal();}
3.26
dubbo_RpcStatus_getFailedAverageElapsed_rdh
/** * get failed average elapsed. * * @return failed average elapsed */ public long getFailedAverageElapsed() { long failed = getFailed(); if (failed == 0) { return 0; } return getFailedElapsed() / failed; }
3.26
dubbo_LruCache_get_rdh
/** * API to return stored value using a key against the calling thread specific store. * * @param key * Unique identifier for cache lookup * @return Return stored object against key */ @Override public Object get(Object key) { return store.get(key); }
3.26
dubbo_LruCache_put_rdh
/** * API to store value against a key in the calling thread scope. * * @param key * Unique identifier for the object being store. * @param value * Value getting store */@Override public void put(Object key, Object value) { store.put(key, value); }
3.26
dubbo_NetUtils_isValidAddress_rdh
/** * Tells whether the address to test is an invalid address. * * @implNote Pattern matching only. * @param address * address to test * @return true if invalid */ public static boolean isValidAddress(String address) { return ADDRESS_PATTERN.matcher(address).matches(); }
3.26
dubbo_NetUtils_m1_rdh
/** * Tells whether the port to test is an invalid port. * * @implNote Numeric comparison only. * @param port * port to test * @return true if invalid */public static boolean m1(int port) { return (port < MIN_PORT) || (port > MAX_PORT); }
3.26
dubbo_NetUtils_findNetworkInterface_rdh
/** * Get the suitable {@link NetworkInterface} * * @return If no {@link NetworkInterface} is available , return <code>null</code> * @since 2.7.6 */ public static NetworkInterface findNetworkInterface() { List<NetworkInterface> validNetworkInterfaces = emptyList(); try { validNetworkInterfaces = getValidNetworkInt...
3.26
dubbo_NetUtils_getValidNetworkInterfaces_rdh
/** * Get the valid {@link NetworkInterface network interfaces} * * @return the valid {@link NetworkInterface}s * @throws SocketException * SocketException if an I/O error occurs. * @since 2.7.6 */ private static List<NetworkInterface> getValidNetworkInterfaces() throws SocketException { List<NetworkInterface>...
3.26
dubbo_NetUtils_getLocalAddress_rdh
/** * Find first valid IP from local network card * * @return first valid local IP */ public static InetAddress getLocalAddress() { if (LOCAL_ADDRESS != null) { return LOCAL_ADDRESS; } InetAddress localAddress = getLocalAddress0(); LOCAL_ADDRESS = localAddress; return localAddress; }
3.26
dubbo_NetUtils_matchIpRange_rdh
/** * * @param pattern * @param host * @param port * @return * @throws UnknownHostException */ public static boolean matchIpRange(String pattern, String host, int port) throws UnknownHostException { if ((pattern == null) || (host == null)) {throw new IllegalArgumentException((("Illegal Argument pattern or host...
3.26
dubbo_NetUtils_getIpByHost_rdh
/** * * @param hostName * @return ip address or hostName if UnknownHostException */ public static String getIpByHost(String hostName) { try { return InetAddress.getByName(hostName).getHostAddress(); } catch (UnknownHostException e) { return hostName; } }
3.26
dubbo_NetUtils_isPortInUsed_rdh
/** * Check the port whether is in use in os * * @param port * port to check * @return true if it's occupied */ public static boolean isPortInUsed(int port) { try (ServerSocket ignored = new ServerSocket(port)) { return false;} catch (IOException e) { // continue } return true; }
3.26
dubbo_NetUtils_isPreferIPV6Address_rdh
/** * Check if an ipv6 address * * @return true if it is reachable */ static boolean isPreferIPV6Address() { return Boolean.getBoolean("java.net.preferIPv6Addresses"); }/** * normalize the ipv6 Address, convert scope name to scope id. * e.g. * convert * fe80:0:0:0:894:aeec:f37d:23e1%en0 * to * fe80:0:0:0:...
3.26
dubbo_NetUtils_isMulticastAddress_rdh
/** * is multicast address or not * * @param host * ipv4 address * @return {@code true} if is multicast address */ public static boolean isMulticastAddress(String host) { int i = host.indexOf('.'); if (i > 0) { String prefix = host.substring(0, i); if (StringUtils.isNumber(prefix)) { int p = Integer.p...
3.26
dubbo_FileCacheStoreFactory_getCacheMap_rdh
/** * for unit test only */ @Deprecated static Map<String, FileCacheStore> getCacheMap() { return f0; }
3.26
dubbo_PermissionLevel_from_rdh
// find the permission level by the level value, if not found, return default PUBLIC level public static PermissionLevel from(String permissionLevel) { if (StringUtils.isNumber(permissionLevel)) { return Arrays.stream(values()).filter(p -> String.valueOf(p.getLevel()).equals(permissionLevel.trim())).findFir...
3.26
dubbo_ApplicationConfig_getQosEnableCompatible_rdh
/** * The format is the same as the springboot, including: getQosEnableCompatible(), getQosPortCompatible(), getQosAcceptForeignIpCompatible(). * * @return */ @Parameter(key = QOS_ENABLE_COMPATIBLE, excluded = true, attribute = false) public Boolean getQosEnableCompatible() { return getQosEnable(); }
3.26
dubbo_BeanRegistrar_hasAlias_rdh
/** * Detect the alias is present or not in the given bean name from {@link AliasRegistry} * * @param registry * {@link AliasRegistry} * @param beanName * the bean name * @param alias * alias to test * @return if present, return <code>true</code>, or <code>false</code> */ public static boolean hasAlias(...
3.26
dubbo_NacosConnectionManager_createNamingService_rdh
/** * Create an instance of {@link NamingService} from specified {@link URL connection url} * * @return {@link NamingService} */ protected NamingService createNamingService() { Properties nacosProperties = buildNacosProperties(this.connectionURL); NamingService namingService = null; try { for (int i = 0; i < (...
3.26
dubbo_AbstractInvoker_getCallbackExecutor_rdh
// -- Protected api protected ExecutorService getCallbackExecutor(URL url, Invocation inv) { if (InvokeMode.SYNC == RpcUtils.getInvokeMode(getUrl(), inv)) { return new ThreadlessExecutor(); } return ExecutorRepository.getInstance(url.getOrDefaultApplicationModel()).getExecutor(url); }
3.26
dubbo_AbstractInvoker_attachInvocationSerializationId_rdh
/** * Attach Invocation Serialization id * <p> * <ol> * <li>Obtain the value from <code>prefer_serialization</code></li> * <li>If the preceding information is not obtained, obtain the value from <code>serialization</code></li> * <li>If neither is obtained, use the default value</li> *...
3.26
dubbo_AbstractInvoker_getInterface_rdh
// -- Public api @Override public Class<T> getInterface() { return type; }
3.26
dubbo_DubboComponentScanRegistrar_registerServiceAnnotationPostProcessor_rdh
/** * Registers {@link ServiceAnnotationPostProcessor} * * @param packagesToScan * packages to scan without resolving placeholders * @param registry * {@link BeanDefinitionRegistry} * @since 2.5.8 */ private void registerServiceAnnotationPostProcessor(Set<String> packagesToScan, BeanDefinitionRegistry regis...
3.26
dubbo_AbstractDubboConfigBinder_getPropertySources_rdh
/** * Get multiple {@link PropertySource propertySources} * * @return multiple {@link PropertySource propertySources} */ protected Iterable<PropertySource<?>> getPropertySources() { return f0; }
3.26
dubbo_LazyConnectExchangeClient_warning_rdh
/** * If {@link Constants.LAZY_REQUEST_WITH_WARNING_KEY} is configured, then warn once every 5000 invocations. */ private void warning() { if (requestWithWarning) { if ((f0.get() % warningPeriod) == 0) { logger.warn(PROTOCOL_FAILED_REQUEST, "", "", ((url.getAddress() + " ") + url.getServi...
3.26
dubbo_ResteasyContext_getExtension_rdh
/** * return extensions that are filtered by extension type * * @param extension * @param <T> * @return */ default <T> List<T> getExtension(ServiceDeployer serviceDeployer, Class<T> extension) { return serviceDeployer.getExtensions(extension); }
3.26
dubbo_ServiceModel_getServiceConfig_rdh
/** * ServiceModel should be decoupled from AbstractInterfaceConfig and removed in a future version * * @return */ @Deprecated public ServiceConfigBase<?> getServiceConfig() { if (config == null) { return null; } if (config instanceof ServiceConfigBase) { return ...
3.26
dubbo_ServiceModel_getServiceMetadata_rdh
/** * * @return serviceMetadata */ public ServiceMetadata getServiceMetadata() { return serviceMetadata; }
3.26
dubbo_ServiceModel_getReferenceConfig_rdh
/** * ServiceModel should be decoupled from AbstractInterfaceConfig and removed in a future version * * @return */ @Deprecated public ReferenceConfigBase<?> getReferenceConfig() { if (config == null) { return null; } if (config instanceof ReferenceConfigBase) { return ((Referenc...
3.26
dubbo_ZookeeperRegistry_fetchLatestAddresses_rdh
/** * When zookeeper connection recovered from a connection loss, it needs to fetch the latest provider list. * re-register watcher is only a side effect and is not mandate. */private void fetchLatestAddresses() { // subscribe Map<URL, Set<NotifyListener>> recoverSubscribed = new HashMap<>(getSubscribed()); if (!rec...
3.26
dubbo_AbstractDependencyFilterMojo_getFilters_rdh
/** * Return artifact filters configured for this MOJO. * * @param additionalFilters * optional additional filters to apply * @return the filters */ private FilterArtifacts getFilters(ArtifactsFilter... additionalFilters) { FilterArtifacts filters = new FilterArtifacts(); for (ArtifactsFilter additi...
3.26
dubbo_MonitorFilter_getConcurrent_rdh
/** * concurrent counter * * @param invoker * @param invocation * @return */ private AtomicInteger getConcurrent(Invoker<?> invoker, Invocation invocation) {String key = (invoker.getInterface().getName() + ".") + RpcUtils.getMethodName(invocation); return ConcurrentHashMapUtils.computeIfAbsent(concurrent...
3.26
dubbo_MonitorFilter_invoke_rdh
/** * The invocation interceptor,it will collect the invoke data about this invocation and send it to monitor center * * @param invoker * service * @param invocation * invocation. * @return {@link Result} the invoke result * @throws RpcException */ @Override public Result invoke(Invoker<?> invoker, Invocat...
3.26
dubbo_MonitorFilter_collect_rdh
/** * The collector logic, it will be handled by the default monitor * * @param invoker * @param invocation * @param result * the invocation result * @param remoteHost * the remote host address * @param start * the timestamp the invocation begin * @param ...
3.26
dubbo_LockUtils_getSingletonMutex_rdh
/** * Get the mutex to lock the singleton in the specified {@link ApplicationContext} */ public static synchronized Object getSingletonMutex(ApplicationContext applicationContext) {DefaultSingletonBeanRegistry autowireCapableBeanFactory = ((DefaultSingletonBeanRegistry) (applicationContext.getAutowireCapableBeanFacto...
3.26
dubbo_ProviderConfig_getExportBackground_rdh
/** * * @deprecated replace with {@link ModuleConfig#getBackground()} * @see ModuleConfig#getBackground() */ @Deprecated @Parameter(key = EXPORT_BACKGROUND_KEY, excluded = true) public Boolean getExportBackground() { return exportBackground;} /** * Whether export should run in background or not. * * @deprec...
3.26
dubbo_DefaultFilterChainBuilder_buildClusterInvokerChain_rdh
/** * build consumer cluster filter chain */ @Override public <T> ClusterInvoker<T> buildClusterInvokerChain(final ClusterInvoker<T> originalInvoker, String key, String group) { ClusterInvoker<T> last = originalInvoker; URL url = originalInvoker.getUrl(); List<ModuleModel> moduleModels = getModuleModel...
3.26
dubbo_DefaultFilterChainBuilder_getModuleModelsFromUrl_rdh
/** * When the application-level service registration and discovery strategy is adopted, the URL will be of type InstanceAddressURL, * and InstanceAddressURL belongs to the application layer and holds the ApplicationModel, * but the filter is at the module layer and holds the ModuleModel, * so it needs to be based ...
3.26
dubbo_ServiceDiscoveryFactory_getExtension_rdh
/** * Get the extension instance of {@link ServiceDiscoveryFactory} by {@link URL#getProtocol() the protocol} * * @param registryURL * the {@link URL} to connect the registry * @return non-null */ static ServiceDiscoveryFactory getExtension(URL registryURL) { String protocol = registryURL.getProtocol(); ...
3.26
dubbo_AbstractStateRouter_setNextRouter_rdh
/** * Next Router node state is maintained by AbstractStateRouter and this method is not allow to override. * If a specified router wants to control the behaviour of continue route or not, * please override {@link AbstractStateRouter#supportContinueRoute()} */ @Override public final void setNextRouter(StateRouter<T...
3.26
dubbo_AbstractStateRouter_continueRoute_rdh
/** * Call next router to get result * * @param invokers * current router filtered invokers */protected final BitList<Invoker<T>> continueRoute(BitList<Invoker<T>> invokers, URL url, Invocation invocation, boolean needToPrintMessage, Holder<RouterSnapshotNode<T>> nodeHolder) { if (nextRouter != null) { return n...
3.26
dubbo_AbstractStateRouter_supportContinueRoute_rdh
/** * Whether current router's implementation support call * {@link AbstractStateRouter#continueRoute(BitList, URL, Invocation, boolean, Holder)} * by router itself. * * @return support or not */ protected boolean supportContinueRoute() { return false; }
3.26
dubbo_JsonUtils_setJson_rdh
/** * * @deprecated for uts only */ @Deprecated protected static void setJson(JSON json) { JsonUtils.json = json; }
3.26
dubbo_MulticastRegistry_m0_rdh
/** * Remove the expired providers(if clean is true), leave the multicast group and close the multicast socket. */ @Override public void m0() { super.destroy(); try { ExecutorUtil.cancelScheduledFuture(cleanFuture); } catch (Throwable t) { logger.warn(REGISTRY_SOCKET_EXCEPTION, "", "", t.getMessage(), t); } try {...
3.26
dubbo_MulticastRegistry_clean_rdh
/** * Remove the expired providers, only when "clean" parameter is true. */ private void clean() { if (admin) { for (Set<URL> providers : new HashSet<Set<URL>>(received.values())) { for (URL url : new HashSet<URL>(providers)) { if (isExpired(url)) { if (logger.isWarnEnabled()) ...
3.26
dubbo_RequestEvent_toRequestErrorEvent_rdh
/** * Acts on MetricsClusterFilter to monitor exceptions that occur before request execution */ public static RequestEvent toRequestErrorEvent(ApplicationModel applicationModel, String appName, MetricsDispatcher metricsDispatcher, Invocation invocation, String side, int code, boolean serviceLevel) { RequestEvent...
3.26
dubbo_CollectionUtils_isEmpty_rdh
/** * Return {@code true} if the supplied Collection is {@code null} or empty. * Otherwise, return {@code false}. * * @param collection * the Collection to check * @return whether the given Collection is empty */public static boolean isEmpty(Collection<?> collection) { return (collection == null) || collection...
3.26
dubbo_CollectionUtils_isNotEmptyMap_rdh
/** * Return {@code true} if the supplied Map is {@code not null} or not empty. * Otherwise, return {@code false}. * * @param map * the Map to check * @return whether the given Map is not empty */ public static boolean isNotEmptyMap(Map map) { return !isEmptyMap(map); }
3.26
dubbo_CollectionUtils_equals_rdh
/** * Compares the specified collection with another, the main implementation references * {@link AbstractSet} * * @param one * {@link Collection} * @param another * {@link Collection} * @return if equals, return <code>true</code>, or <code>false</code> * @since 2.7.6 */ public static boolean equals(Colle...
3.26
dubbo_CollectionUtils_ofSet_rdh
/** * Convert to multiple values to be {@link LinkedHashSet} * * @param values * one or more values * @param <T> * the type of <code>values</code> * @return read-only {@link Set} */ public static <T> Set<T> ofSet(T... values) { int size = (values == null) ? 0 : values.length; if (size < 1) { return emptySet...
3.26
dubbo_CollectionUtils_isNotEmpty_rdh
/** * Return {@code true} if the supplied Collection is {@code not null} or not empty. * Otherwise, return {@code false}. * * @param collection * the Collection to check * @return whether the given Collection is not empty */ public static boolean isNotEmpty(Collection<?> collection) { return !isEmpty(collect...
3.26
dubbo_CollectionUtils_size_rdh
/** * Get the size of the specified {@link Collection} * * @param collection * the specified {@link Collection} * @return must be positive number * @since 2.7.6 */ public static int size(Collection<?> collection) { return collection == null ? 0 : collection.size(); }
3.26
dubbo_CollectionUtils_flip_rdh
/** * Flip the specified {@link Map} * * @param map * The specified {@link Map},Its value must be unique * @param <K> * The key type of specified {@link Map} * @param <V> * The value type of specified {@link Map} * @return {@link Map} */ @SuppressWarnings("unchecked") public static <K, V> Map<V, K> flip...
3.26
dubbo_CollectionUtils_addAll_rdh
/** * Add the multiple values into {@link Collection the specified collection} * * @param collection * {@link Collection the specified collection} * @param values * the multiple values * @param <T> * the type of values * @return the effected count after added * @since 2.7.6 */ public static <T> int ad...
3.26
dubbo_CollectionUtils_first_rdh
/** * Take the first element from the specified collection * * @param values * the collection object * @param <T> * the type of element of collection * @return if found, return the first one, or <code>null</code> * @since 2.7.6 */ public static <T> T first(Collection<T> values) {if (isEmpty(values)) { retu...
3.26
dubbo_CollectionUtils_isEmptyMap_rdh
/** * Return {@code true} if the supplied Map is {@code null} or empty. * Otherwise, return {@code false}. * * @param map * the Map to check * @return whether the given Map is empty */ public static boolean isEmptyMap(Map map) { return (map == null) || (map.size() == 0); }
3.26
dubbo_Help_mainHelp_rdh
/* output main help */private String mainHelp() { final TTable tTable = new TTable(new TTable.ColumnDefine[]{ new TTable.ColumnDefine(Align.RIGHT), new TTable.ColumnDefine(80, false, Align.LEFT) }); final List<Class<?>> classes = commandHelper.getAllCommandClass(); Collections.sort(classes, new Comparator<Class<?>>() ...
3.26
dubbo_InternalServiceConfigBuilder_getRelatedOrDefaultProtocol_rdh
/** * Get other configured protocol from environment in priority order. If get nothing, use default dubbo. * * @return */ private String getRelatedOrDefaultProtocol() { String protocol = ""; // <dubbo:consumer/> List<ModuleModel> moduleModels = applicationModel.getPubModuleModels(); protocol = modul...
3.26
dubbo_NacosMetadataReport_innerReceive_rdh
/** * receive * * @param dataId * data ID * @param group * group * @param configInfo * content */ @Override public void innerReceive(String dataId, String group, String configInfo) { String oldValue = cacheData.get(dataId); ConfigChangedEvent event = new ConfigChangedEvent(dataId, group, configIn...
3.26
dubbo_StreamUtils_convertAttachment_rdh
/** * Parse and put the KV pairs into metadata. Ignore Http2 PseudoHeaderName and internal name. * Only raw byte array or string value will be put. * * @param headers * the metadata holder * @param attachments * KV pairs * @param needConvertHeaderKey * convert flag */ public static void convertAttachmen...
3.26
dubbo_StreamUtils_convertSingleAttachment_rdh
/** * Convert each user's attach value to metadata * * @param headers * outbound headers * @param key * metadata key * @param v * metadata value (Metadata Only string and byte arrays are allowed) */ private static vo...
3.26
dubbo_CodecSupport_isHeartBeat_rdh
/** * Check if payload is null object serialize result byte[] of serialization * * @param payload * @param proto * @return */ public static boolean isHeartBeat(byte[] payload, byte proto) { return Arrays.equals(payload, getNullBytesOf(getSerializationById(proto))); }
3.26