name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
dubbo_CacheFilter_invoke_rdh | /**
* If cache is configured, dubbo will invoke method on each method call. If cache value is returned by cache store
* then it will return otherwise call the remote method and return value. If remote method's return value has error
* then it will not cache the value.
*
* @param invoker
* service
* @param invo... | 3.26 |
dubbo_AbstractConnectionClient_release_rdh | /**
* Decreases the reference count by 1 and calls {@link this#destroy} if the reference count reaches 0.
*/
public final boolean release() {
long remainingCount = COUNTER_UPDATER.decrementAndGet(this);
if (remainingCount == 0) {
m1();
return true;
} else if (remainingCount <= (-1)) {
... | 3.26 |
dubbo_AbstractConnectionClient_getCounter_rdh | /**
* Get counter
*/
public long getCounter() {
return COUNTER_UPDATER.get(this);
} | 3.26 |
dubbo_PackableMethod_parseRequest_rdh | /**
* A packable method is used to customize serialization for methods. It can provide a common wrapper
* for RESP / Protobuf.
*/
| 3.26 |
dubbo_ConfigValidationUtils_checkMock_rdh | /**
* Legitimacy check and setup of local simulated operations. The operations can be a string with Simple operation or
* a classname whose {@link Class} implements a particular function
*
* @param interfaceClass
* for provider side, it is the {@link Class} of the service that will be exported; for consumer
* ... | 3.26 |
dubbo_ConfigValidationUtils_checkMultiExtension_rdh | /**
* Check whether there is a <code>Extension</code> who's name (property) is <code>value</code> (special treatment is
* required)
*
* @param type
* The Extension type
* @param property
* The extension key
* @param value
* The Extension name
*/
public static void checkMultiExtension(ScopeModel scopeMod... | 3.26 |
dubbo_ServiceInstanceMetadataUtils_getEndpoint_rdh | /**
* Get the property value of port by the specified {@link ServiceInstance#getMetadata() the metadata of
* service instance} and protocol
*
* @param serviceInstance
* {@link ServiceInstance service instance}
* @param protocol
* the name of protocol, e.g, dubbo, rest, and so on
* @return if not found, retu... | 3.26 |
dubbo_ServiceInstanceMetadataUtils_getMetadataStorageType_rdh | /**
* Get the metadata storage type specified by the peer instance.
*
* @return storage type, remote or local
*/
public static String getMetadataStorageType(ServiceInstance serviceInstance) {
Map<String, String> metadata = serviceInstance.getMetadata();
return metadata.getOrDefault(METADATA_STORAGE_TYPE_P... | 3.26 |
dubbo_ServiceInstanceMetadataUtils_setDefaultParams_rdh | /**
* Set the default parameters via the specified {@link URL providerURL}
*
* @param params
* the parameters
* @param providerURL
* the provider's {@link URL}
*/
private static void setDefaultParams(Map<String, String> params, URL providerURL) {
for (String parameterName : DEFAULT_REGISTER_PROVIDER_K... | 3.26 |
dubbo_ServiceInstanceMetadataUtils_setMetadataStorageType_rdh | /**
* Set the metadata storage type in specified {@link ServiceInstance service instance}
*
* @param serviceInstance
* {@link ServiceInstance service instance}
* @param metadataType
* remote or local
*/
public static void setMetadataStorageType(ServiceInstance serviceInstance, String metadataType) {
Map<... | 3.26 |
dubbo_ServiceInstanceMetadataUtils_getExportedServicesRevision_rdh | /**
* The revision for all exported Dubbo services from the specified {@link ServiceInstance}.
*
* @param serviceInstance
* the specified {@link ServiceInstance}
* @return <code>null</code> if not exits
*/
public static String getExportedServicesRevision(ServiceInstance serviceInstance) {
return Optional.o... | 3.26 |
dubbo_ConfigurationCache_computeIfAbsent_rdh | /**
* Get Cached Value
*
* @param key
* key
* @param function
* function to produce value, should not return `null`
* @return value
*/
public String computeIfAbsent(String key, Function<String, String> function) {
String value = cache.get(key);
// value might be empty here!
// empty value from ... | 3.26 |
dubbo_ParamType_addSupportTypes_rdh | /**
* exclude null types
*
* @param classes
* @return */
private static List<Class> addSupportTypes(Class... classes) {
ArrayList<Class> types = new ArrayList<>();
for (Class clazz : classes) {
if (clazz == null) {
continue;
}
types.add(clazz);
}
... | 3.26 |
dubbo_BasicJsonWriter_print_rdh | /**
* Write the specified text.
*
* @param string
* the content to write
*/
public IndentingWriter print(String string) {
write(string.toCharArray(), 0, string.length());
return this;
} | 3.26 |
dubbo_BasicJsonWriter_println_rdh | /**
* Write a new line.
*/
public IndentingWriter println() {
String separator = System.lineSeparator();
try
{this.out.write(separator.toCharArray(), 0, separator.length());
} catch (IOException ex) {
throw new IllegalStateException(ex);
}
this.prependIndent = true;
return this;
} | 3.26 |
dubbo_BasicJsonWriter_indent_rdh | /**
* Increase the indentation level.
*/
private IndentingWriter indent() {
this.level++;
return refreshIndent();} | 3.26 |
dubbo_BasicJsonWriter_writeObject_rdh | /**
* Write an object with the specified attributes. Each attribute is
* written according to its value type:
* <ul>
* <li>Map: write the value as a nested object</li>
* <li>List: write the value as a nested array</li>
* <li>Otherwise, write a single value</li>
* </ul>
*
* @param attributes
* the attributes... | 3.26 |
dubbo_BasicJsonWriter_writeArray_rdh | /**
* Write an array with the specified items. Each item in the
* list is written either as a nested object or as an attribute
* depending on its type.
*
* @param items
* the items to write
* @see #writeObject(Map)
*/
public void writeArray(List<?> items) {
writeArray(items, true);
} | 3.26 |
dubbo_BasicJsonWriter_outdent_rdh | /**
* Decrease the indentation level.
*/
private IndentingWriter outdent() {
this.level--;
return refreshIndent();
} | 3.26 |
dubbo_BasicJsonWriter_indented_rdh | /**
* Increase the indentation level and execute the {@link Runnable}. Decrease the
* indentation level on completion.
*
* @param runnable
* the code to execute within an extra indentation level
*/
public IndentingWriter indented(Runnable runnable) {
indent();
runnable.run();return outdent();
} | 3.26 |
dubbo_RpcContextAttachment_set_rdh | /**
* set value.
*
* @param key
* @param value
* @return context
*/
@Override
@Deprecated
public RpcContextAttachment set(String key, Object value) {return setAttachment(key, value);
} | 3.26 |
dubbo_RpcContextAttachment_startAsync_rdh | /**
*
* @return * @throws IllegalStateException
*/
@SuppressWarnings("unchecked")
public static AsyncContext startAsync() throws IllegalStateException {
RpcContextAttachment v0 = getServerAttachment();
if (v0.asyncContext == null) {
v0.asyncContext = new AsyncContextImpl();
}
v0.asyncContext... | 3.26 |
dubbo_RpcContextAttachment_getAttachment_rdh | /**
* also see {@link #getObjectAttachment(String)}.
*
* @param key
* @return attachment
*/
@Override
public String getAttachment(String key) {
Object value = attachments.get(key);
if (value instanceof String) {
return ((String) (value));
}
return null;// or JSON.toString(value);
} | 3.26 |
dubbo_RpcContextAttachment_getObjectAttachments_rdh | /**
* get attachments.
*
* @return attachments
*/
@Override
@Experimental("Experiment api for supporting Object transmission")
public Map<String,
Object> getObjectAttachments() {
return attachments;
} | 3.26 |
dubbo_RpcContextAttachment_setAttachments_rdh | /**
* set attachments
*
* @param attachment
* @return context
*/
@Override
public RpcContextAttachment setAttachments(Map<String, String> attachment) {
this.attachments.clear();
if ((attachment != null)
&& (attachment.size() > 0)) {
this.attachments.putAll(attachment);
}
return this;
} | 3.26 |
dubbo_RpcContextAttachment_copyOf_rdh | /**
* Also see {@link RpcServiceContext#copyOf(boolean)}
*
* @return a copy of RpcContextAttachment with deep copied attachments
*/
public RpcContextAttachment copyOf(boolean needCopy) {
if (!isValid())
{
return null;
}
if
(needCopy) {
RpcContextAttachment copy = new RpcContextAt... | 3.26 |
dubbo_ServiceBean_setApplicationEventPublisher_rdh | /**
*
* @param applicationEventPublisher
* @since 2.6.5
*/
@Override
public void setApplicationEventPublisher(ApplicationEventPublisher applicationEventPublisher) {
this.applicationEventPublisher = applicationEventPublisher;
} | 3.26 |
dubbo_ServiceBean_getBeanName_rdh | /**
* Get the name of {@link ServiceBean}
*
* @return {@link ServiceBean}'s name
* @since 2.6.5
*/
@Parameter(excluded = true, attribute = false)
public String getBeanName() {
return this.beanName;
} | 3.26 |
dubbo_ServiceBean_publishExportEvent_rdh | /**
*
* @since 2.6.5
*/
private void publishExportEvent() {
ServiceBeanExportedEvent exportEvent = new ServiceBeanExportedEvent(this);
applicationEventPublisher.publishEvent(exportEvent);
} | 3.26 |
dubbo_ServiceBean_getServiceClass_rdh | // merged from dubbox
@Override
protected Class getServiceClass(T ref)
{
if (AopUtils.isAopProxy(ref)) {
return
AopUtils.getTargetClass(ref);
}
return super.getServiceClass(ref);
} | 3.26 |
dubbo_ServiceBean_exported_rdh | /**
*
* @since 2.6.5
*/
@Override
protected void exported() {
super.exported();
// Publish ServiceBeanExportedEvent
publishExportEvent();
} | 3.26 |
dubbo_ServiceBean_getService_rdh | /**
* Gets associated {@link Service}
*
* @return associated {@link Service}
*/
public Service getService()
{
return service;
} | 3.26 |
dubbo_DubboAnnotationUtils_resolveInterfaceName_rdh | /**
* Resolve the service interface name from @Service annotation attributes.
* <p/>
* Note: the service interface class maybe not found locally if is a generic service.
*
* @param attributes
* annotation attributes of {@link Service @Service}
* @param defaultInterfaceClass
* the default class of interface
... | 3.26 |
dubbo_DubboAnnotationUtils_convertParameters_rdh | /**
* Resolve the parameters of {@link org.apache.dubbo.config.annotation.DubboService}
* and {@link org.apache.dubbo.config.annotation.DubboReference} from the specified.
* It iterates elements in order.The former element plays as key or key&value role, it would be
* spilt if it contains specific string, for insta... | 3.26 |
dubbo_ApolloDynamicConfiguration_getInternalProperty_rdh | /**
* This method will be used by Configuration to get valid value at runtime.
* The group is expected to be 'app level', which can be fetched from the 'config.appnamespace' in url if necessary.
* But I think Apollo's inheritance feature of namespace can solve the problem .
*/
@Override
public String getInternalPro... | 3.26 |
dubbo_ApolloDynamicConfiguration_addListener_rdh | /**
* Since all governance rules will lay under dubbo group, this method now always uses the default dubboConfig and
* ignores the group parameter.
*/
@Override
public void addListener(String key, String group, ConfigurationListener listener) {
ApolloListener v8 = listeners.computeIfAbsent(group + key, k -> cr... | 3.26 |
dubbo_ApolloDynamicConfiguration_m0_rdh | /**
* Recommend specify namespace and group when using Apollo.
* <p>
* <dubbo:config-center namespace="governance" group="dubbo" />, 'dubbo=governance' is for governance rules while
* 'group=dubbo' is for properties files.
*
* @param key
* default value is 'dubbo.properties', currently useless for Apollo.
* @... | 3.26 |
dubbo_ApolloDynamicConfiguration_createTargetListener_rdh | /**
* Ignores the group parameter.
*
* @param key
* property key the native listener will listen on
* @param group
* to distinguish different set of properties
* @return */
private ApolloListener createTargetListener(String key, String group) {
return new ApolloListener();
} | 3.26 |
dubbo_JValidatorNew_generateMethodParameterClass_rdh | /**
* try to generate methodParameterClass.
*
* @param clazz
* interface class
* @param method
* invoke method
* @param parameterClassName
* generated parameterClassName
* @return Class<?> generated methodParameterClass
... | 3.26 |
dubbo_JValidatorNew_createMemberValue_rdh | // Copy from javassist.bytecode.annotation.Annotation.createMemberValue(ConstPool, CtClass);
private static MemberValue createMemberValue(ConstPool cp, CtClass type, Object value) throws NotFoundException {
MemberValue memberValue = annotation.Annotation.createMemberValue(cp, type);
if (memberValue instanceof BooleanMe... | 3.26 |
dubbo_DubboHealthIndicator_resolveStatusCheckerNamesMap_rdh | /**
* Resolves the map of {@link StatusChecker}'s name and its' source.
*
* @return non-null {@link Map}
*/
protected Map<String, String> resolveStatusCheckerNamesMap() {
Map<String, String> statusCheckerNamesMap = new LinkedHashMap<>();
statusCheckerNamesMap.putAll(resolveStatusCheckerNamesMapFromDubboHeal... | 3.26 |
dubbo_DefaultServiceRestMetadataResolver_supportsPathVariableType_rdh | /**
* Supports the type of parameter or not, based by {@link Converter}'s conversion feature
*
* @param parameterType
* the type of parameter
* @return if supports, this method will return <code>true</code>, or <code>false</code>
*/
private boolean supportsPathVariableType(TypeMirror parameterType) {
String... | 3.26 |
dubbo_ScopeModelAware_setApplicationModel_rdh | /**
* Override this method if you just need application model
*
* @param applicationModel
*/
default void setApplicationModel(ApplicationModel applicationModel) {
} | 3.26 |
dubbo_ScopeModelAware_setFrameworkModel_rdh | /**
* Override this method if you just need framework model
*
* @param frameworkModel
*/
default void setFrameworkModel(FrameworkModel frameworkModel) {
} | 3.26 |
dubbo_ScopeModelAware_setModuleModel_rdh | /**
* Override this method if you just need module model
*
* @param moduleModel
*/
default void setModuleModel(ModuleModel moduleModel) {
} | 3.26 |
dubbo_IOUtils_write_rdh | /**
* write.
*
* @param reader
* Reader.
* @param writer
* Writer.
* @param bufferSize
* buffer size.
* @return count.
* @throws IOException
* If an I/O error occurs
*/
public static long write(Reader reader, Writer writer, int bufferSize) throws IOException {
int read;
long total = 0;
... | 3.26 |
dubbo_IOUtils_read_rdh | /**
* read string.
*
* @param reader
* Reader instance.
* @return String.
* @throws IOException
* If an I/O error occurs
*/
public static String read(Reader reader) throws IOException {
try (StringWriter writer = new StringWriter()) {
write(reader, writer);
return writer.getBuffer().toSt... | 3.26 |
dubbo_IOUtils_getURL_rdh | /**
* use like spring code
*
* @param resourceLocation
* @return */
public static URL getURL(String resourceLocation) throws FileNotFoundException {
Assert.notNull(resourceLocation, "Resource location must not be null");
if (resourceLocation.startsWith(CommonConstants.CLASSPATH_URL_PREFIX)) {
Strin... | 3.26 |
dubbo_IOUtils_writeLines_rdh | /**
* write lines.
*
* @param file
* file.
* @param lines
* lines.
* @throws IOException
* If an I/O error occurs
*/
public static void
writeLines(File file, String[] lines) throws IOException {
if (file == null) {
throw new IOException("File is null.");
}writeLines(new
FileOutputStr... | 3.26 |
dubbo_IOUtils_readLines_rdh | /**
* read lines.
*
* @param is
* input stream.
* @return lines.
* @throws IOException
* If an I/O error occurs
*/
public static String[] readLines(InputStream is) throws IOException {
List<String> lines = new ArrayList<String>();
try (BufferedReader reader = new BufferedReader(new InputStreamReader... | 3.26 |
dubbo_QosProcessHandler_isHttp_rdh | // G for GET, and P for POST
private static boolean isHttp(int magic) {
return (magic == 'G') || (magic == 'P');
} | 3.26 |
dubbo_ConfigManager_setMonitor_rdh | // MonitorConfig correlative methods
@DisableInject
public void setMonitor(MonitorConfig monitor) {
addConfig(monitor);
} | 3.26 |
dubbo_ConfigManager_setApplication_rdh | // ApplicationConfig correlative methods
/**
* Set application config
*
* @param application
* @return current application config instance
*/
@DisableInject
public void setApplication(ApplicationConfig application) {
addConfig(application);
} | 3.26 |
dubbo_ConfigManager_addProtocol_rdh | // ProtocolConfig correlative methods
public void addProtocol(ProtocolConfig protocolConfig) {
addConfig(protocolConfig);
} | 3.26 |
dubbo_ConfigManager_addConfigCenter_rdh | // ConfigCenterConfig correlative methods
public void addConfigCenter(ConfigCenterConfig configCenter)
{
addConfig(configCenter);
} | 3.26 |
dubbo_ConfigManager_addMetadataReport_rdh | // MetadataReportConfig correlative methods
public void addMetadataReport(MetadataReportConfig metadataReportConfig) {
addConfig(metadataReportConfig);
} | 3.26 |
dubbo_ConfigManager_addRegistry_rdh | // RegistryConfig correlative methods
public void addRegistry(RegistryConfig registryConfig) {
addConfig(registryConfig);
} | 3.26 |
dubbo_FrameworkExecutorRepository_getMappingRefreshingExecutor_rdh | /**
* Executor used to run async mapping tasks
*
* @return ExecutorService
*/
public ExecutorService getMappingRefreshingExecutor() {
return mappingRefreshingExecutor;
} | 3.26 |
dubbo_FrameworkExecutorRepository_getConnectivityScheduledExecutor_rdh | /**
* Scheduled executor handle connectivity check task
*
* @return ScheduledExecutorService
*/
public ScheduledExecutorService getConnectivityScheduledExecutor() {
return connectivityScheduledExecutor;
} | 3.26 |
dubbo_FrameworkExecutorRepository_getSharedScheduledExecutor_rdh | /**
* Get the shared schedule executor
*
* @return ScheduledExecutorService
*/
public ScheduledExecutorService getSharedScheduledExecutor() {
return sharedScheduledExecutor;
} | 3.26 |
dubbo_FrameworkExecutorRepository_nextScheduledExecutor_rdh | /**
* Returns a scheduler from the scheduler list, call this method whenever you need a scheduler for a cron job.
* If your cron cannot burden the possible schedule delay caused by sharing the same scheduler, please consider define a dedicated one.
*
* @return ScheduledExecutorService
*/public ScheduledExecutorSer... | 3.26 |
dubbo_InstanceMetadataChangedListener_echo_rdh | /**
* Echo test
* Used to check consumer still online
*/
default String
echo(String msg) {
return msg;
} | 3.26 |
dubbo_TripleClientCall_halfClose_rdh | // stream listener end
@Override
public void halfClose() {
if (!headerSent) {
return;
}
if (canceled) {
return;
}
stream.halfClose().addListener(f -> {
if (!f.isSuccess()) {
cancelByLocal(new IllegalStateException("Half close failed", f.cause()));
}
})... | 3.26 |
dubbo_TripleClientCall_onMessage_rdh | // stream listener start
@Override
public void
onMessage(byte[] message, boolean
isReturnTriException) {
if (done) {
LOGGER.warn(PROTOCOL_STREAM_LISTENER, "", "", (((("Received message from closed stream,connection=" + connectionClient) + " service=") + requestMetadata.service)
+ " method=") + requ... | 3.26 |
dubbo_AbstractPeer_getHandler_rdh | /**
*
* @return ChannelHandler
*/
@Deprecated
public ChannelHandler getHandler()
{
return getDelegateHandler();
} | 3.26 |
dubbo_URL_getPath_rdh | // public List<URL> getBackupUrls() {
// List<org.apache.dubbo.common.URL> res = super.getBackupUrls();
// return res.stream().map(url -> new URL(url)).collect(Collectors.toList());
// }
@Overridepublic String getPath() {
return super.getPath();
} | 3.26 |
dubbo_AnnotationBeanDefinitionParser_doParse_rdh | /**
* parse
* <prev>
* <dubbo:annotation package="" />
* </prev>
*
* @param element
* @param parserContext
* @param builder
*/
@Override
protected void doParse(Element element, ParserContext parserContext,
BeanDefinitionBuilder builder) {String packageToScan =
element.getAttribute("package");
Str... | 3.26 |
dubbo_DubboLoadingStrategy_directory_rdh | /**
* Dubbo {@link LoadingStrategy}
*
* @since 2.7.7
*/public class DubboLoadingStrategy implements LoadingStrategy {@Override
public String directory() {return "META-INF/dubbo/";
} | 3.26 |
dubbo_DubboAutoConfiguration_serviceAnnotationBeanProcessor_rdh | /**
* Creates {@link ServiceAnnotationPostProcessor} Bean
*
* @param packagesToScan
* the packages to scan
* @return {@link ServiceAnnotationPostProcessor}
*/
@ConditionalOnProperty(prefix = DUBBO_SCAN_PREFIX, name = BASE_PACKAGES_PROPERTY_NAME)
@ConditionalOnBean(name = BASE_PACKAGES_BEAN_NAME)
@Bean
public Se... | 3.26 |
dubbo_ScopeClusterInvoker_isNotRemoteOrGeneric_rdh | /**
* Check if the service is a generalized call or the SCOPE_REMOTE parameter is set
*
* @return boolean
*/
private boolean isNotRemoteOrGeneric() {
return (!SCOPE_REMOTE.equalsIgnoreCase(getUrl().getParameter(SCOPE_KEY))) && (!getUrl().getParameter(GENERIC_KEY, false));
} | 3.26 |
dubbo_ScopeClusterInvoker_invoke_rdh | /**
* Checks if the current ScopeClusterInvoker is exported to the local JVM and invokes the corresponding Invoker.
* If it's not exported locally, then it delegates the invocation to the original Invoker.
*
* @param invocation
* the invocation to be performed
* @return the result of the invocation
* @throws R... | 3.26 |
dubbo_ScopeClusterInvoker_isInjvmExported_rdh | /**
* Checks whether the current ScopeClusterInvoker is exported to the local JVM and returns a boolean value.
*
* @return true if the ScopeClusterInvoker is exported to the local JVM, false otherwise
* @throws RpcException
* if there was an error during the invocation
*/
private boolean isInjvmExported() {
Boo... | 3.26 |
dubbo_ScopeClusterInvoker_createInjvmInvoker_rdh | /**
* Creates a new Invoker for the current ScopeClusterInvoker and exports it to the local JVM.
*/
private void createInjvmInvoker(Exporter<?> exporter) {
if (injvmInvoker == null) {
synchronized(createLock) {
if (injvmInvoker == null) {
URL url = new ServiceConfigURL(LOCAL_PROTOCOL, NetUtils.getLocalHo... | 3.26 |
dubbo_ScopeClusterInvoker_destroyInjvmInvoker_rdh | /**
* Destroy the existing InjvmInvoker.
*/
private void destroyInjvmInvoker() {
if (injvmInvoker != null) {
injvmInvoker.destroy();
injvmInvoker = null;
}
} | 3.26 |
dubbo_ScopeClusterInvoker_init_rdh | /**
* Initializes the ScopeClusterInvoker instance.
*/
private void init() {
Boolean peer = ((Boolean) (getUrl().getAttribute(PEER_KEY)));
String isInjvm = getUrl().getParameter(LOCAL_PROTOCOL);
// When the point-to-point direct connection is directly connected,
// the initialization is directly ended
if ((peer != ... | 3.26 |
dubbo_TriDecoder_processBody_rdh | /**
* Processes the GRPC message body, which depending on frame header flags may be compressed.
*/
private void processBody() {
// There is no reliable way to get the uncompressed size per message when it's compressed,
// because the uncompressed bytes are provided through an InputStream whose total size is
... | 3.26 |
dubbo_TriDecoder_processHeader_rdh | /**
* Processes the GRPC compression header which is composed of the compression flag and the outer
* frame length.
*/
private void processHeader() {int type
= accumulate.readUnsignedByte();
if ((type & RESERVED_MASK) != 0) {
throw new RpcException("gRPC frame header malformed: reserved bits not zero... | 3.26 |
dubbo_ThreadLocalCacheFactory_createCache_rdh | /**
* Takes url as an method argument and return new instance of cache store implemented by ThreadLocalCache.
*
* @param url
* url of the method
* @return ThreadLocalCache instance of cache
*/
@Override
protected Cache createCache(URL url) {
return new ThreadLocalCache(url);
} | 3.26 |
dubbo_LoggerAdapter_isConfigured_rdh | /**
* Return is the current logger has been configured.
* Used to check if logger is available to use.
*
* @return true if the current logger has been configured
*/
default boolean isConfigured() {
return true;
} | 3.26 |
dubbo_HashedWheelTimer_clearTimeouts_rdh | /**
* Clear this bucket and return all not expired / cancelled {@link Timeout}s.
*/
void clearTimeouts(Set<Timeout> set) {
for (; ;) {
HashedWheelTimeout v31
= pollTimeout();
if (v31 == null) {
return;
}
if (v31.isExpired() || v31.isCancelled()) {
continue;
}
set.ad... | 3.26 |
dubbo_HashedWheelTimer_addTimeout_rdh | /**
* Add {@link HashedWheelTimeout} to this bucket.
*/
void addTimeout(HashedWheelTimeout timeout) {
assert timeout.bucket == null;
timeout.bucket =
this;
if (head == null)
{
head = tail = timeout;
} else {
tail.next = timeout;
timeout.prev = tail;
tail = timeout;
}
} | 3.26 |
dubbo_HashedWheelTimer_start_rdh | /**
* Starts the background thread explicitly. The background thread will
* start automatically on demand even if you did not call this method.
*
* @throws IllegalStateException
* if this timer has been
* {@linkplain #stop() stopped} already
*/public void start() {
switch (WORKER_STATE_UPDATER.get(this)... | 3.26 |
dubbo_HashedWheelTimer_expireTimeouts_rdh | /**
* Expire all {@link HashedWheelTimeout}s for the given {@code deadline}.
*/
void expireTimeouts(long deadline) {
HashedWheelTimeout timeout = head;
// process all timeouts
while (timeout != null) {
HashedWheelTimeout next = timeout.next;
if (timeout.remainingRounds <= 0) {
next = remove(timeout);
... | 3.26 |
dubbo_LfuCache_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
*/
@SuppressWarnings("unchecked")
@Override
public void put(Object key, Object value) {
f0.put(key, value);
} | 3.26 |
dubbo_LfuCache_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
*/
@SuppressWarnings("unchecked")
@Overridepublic Object get(Object key) {
return f0.get(key);
} | 3.26 |
dubbo_GovernanceRuleRepository_getRule_rdh | /**
* Get the governance rule mapped to the given key and the given group
*
* @param key
* the key to represent a configuration
* @param group
* the group where the key belongs to
* @return target configuration mapped to the given key and the given group
*/
default String getRule(String key, String group) {... | 3.26 |
dubbo_GovernanceRuleRepository_removeListener_rdh | /**
* {@link #removeListener(String, String, ConfigurationListener)}
*
* @param key
* the key to represent a configuration
* @param listener
* configuration listener
*/
default void removeListener(String key, ConfigurationListener listener) {
removeListener(key,
DEFAULT_GROUP, listener);
} | 3.26 |
dubbo_GovernanceRuleRepository_addListener_rdh | /**
* {@link #addListener(String, String, ConfigurationListener)}
*
* @param key
* the key to represent a configuration
* @param listener
* configuration listener
*/
default void addListener(String key, ConfigurationListener listener) {
addListener(key, DEFAULT_GROUP, listener);
} | 3.26 |
dubbo_AbstractServiceBuilder_preferSerialization_rdh | /**
* The prefer serialization type
*
* @param preferSerialization
* prefer serialization type
* @return {@link B}
*/
public B
preferSerialization(String preferSerialization) {
this.preferSerialization = preferSerialization;
return getThis();
} | 3.26 |
dubbo_ConverterUtil_getConverter_rdh | /**
* Get the Converter instance from {@link ExtensionLoader} with the specified source and target type
*
* @param sourceType
* the source type
* @param targetType
* the target type
* @return * @see ExtensionLoader#getSupportedExtensionInstances()
*/
public Converter<?, ?> getConverter(Class<?> sourceType,... | 3.26 |
dubbo_ConverterUtil_convertIfPossible_rdh | /**
* Convert the value of source to target-type value if possible
*
* @param source
* the value of source
* @param targetType
* the target type
* @param <T>
* the target type
* @return <code>null</code> if can't be converted
* @since 2.7.8
*/
public <T> T convertIfPossible(Object source, Class<T> targ... | 3.26 |
dubbo_StubServiceDescriptor_getMethod_rdh | /**
* Does not use Optional as return type to avoid potential performance decrease.
*
* @param methodName
* @param paramTypes
* @return */
public MethodDescriptor getMethod(String methodName, Class<?>[] paramTypes) {
List<MethodDescriptor> methodModels = methods.get(methodName);
if (CollectionUtils.isNotE... | 3.26 |
dubbo_RestInvoker_createHttpConnectionCreateContext_rdh | /**
* create intercept context
*
* @param invocation
* @param serviceRestMetadata
* @param restMethodMetadata
* @param requestTemplate
* @return */
private HttpConnectionCreateContext createHttpConnectionCreateContext(Invocation invocation,
ServiceRestMetadata serviceRestMetadata, RestMethodMetadata restMethodM... | 3.26 |
dubbo_AbstractConditionMatcher_doPatternMatch_rdh | // range, equal or other methods
protected boolean doPatternMatch(String pattern, String value, URL url, Invocation invocation, boolean isWhenCondition) {
for (ValuePattern v6 : f0) {
if (v6.shouldMatch(pattern)) {
return v6.match(pattern, value, url, invocation, isWhenCondition);
... | 3.26 |
dubbo_ClassSourceScanner_spiClassesWithAdaptive_rdh | /**
* Filter out the spi classes with adaptive annotations
* from all the class collections that can be loaded.
*
* @return All spi classes with adaptive annotations
*/
public List<Class<?>> spiClassesWithAdaptive() {
Map<String, Class<?>> allClasses = getClasses();
List<Class<?>> spiClasses = new ArrayL... | 3.26 |
dubbo_ClassSourceScanner_configClasses_rdh | /**
* The required configuration class, which is a subclass of AbstractConfig,
* but which excludes abstract classes.
*
* @return configuration class
*/
public List<Class<?>> configClasses() {
return getClasses().values().stream().filter(c -> AbstractConfig.class.isAssignableFrom(c) && (!Modifier.isAbstract(c.... | 3.26 |
dubbo_ClassSourceScanner_adaptiveClasses_rdh | /**
* The required adaptive class.
* For example: LoadBalance$Adaptive.class
*
* @return adaptive class
*/public Map<String, Class<?>> adaptiveClasses() {
List<String> res = spiClassesWithAdaptive().stream().map(c -> c.getName() + "$Adaptive").collect(Collectors.toList());
... | 3.26 |
dubbo_ClassSourceScanner_scopeModelInitializer_rdh | /**
* Beans that need to be injected in advance in different ScopeModels.
* For example, the RouterSnapshotSwitcher that needs to be injected when ClusterScopeModelInitializer executes initializeFrameworkModel
*
* @return Beans that need to be injected in advance
*/
public List<Class<?>> scopeModelInitializer() {
... | 3.26 |
dubbo_PathMatcher_httpMethodMatch_rdh | /**
* it is needed to compare http method when one of needCompareHttpMethod is true,and don`t compare when both needCompareHttpMethod are false
*
* @param that
* @return */
private boolean httpMethodMatch(PathMatcher that) {
return (!that.needCompareHttpMethod) || (!this.needCompareHttpMethod) ? true : Objects... | 3.26 |
dubbo_ChannelBuffers_prefixEquals_rdh | // prefix
public static boolean prefixEquals(ChannelBuffer bufferA, ChannelBuffer bufferB, int count) {
final int aLen = bufferA.readableBytes();
final int bLen = bufferB.readableBytes();
if ((aLen < count) || (bLen
< count)) {
return false;
}
int aIndex = bufferA.readerIndex();
in... | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.