name stringlengths 12 178 | code_snippet stringlengths 8 36.5k | score float64 3.26 3.68 |
|---|---|---|
dubbo_AbstractJSONImpl_getNumberAsLong_rdh | /**
* Gets a number from an object for the given key, casted to an long. If the key is not
* present, this returns null. If the value does not represent a long integer, throws an
* exception.
*/
@Override
public Long getNumberAsLong(Map<String, ?> obj, String key) {
assert obj != n... | 3.26 |
dubbo_AbstractJSONImpl_checkObjectList_rdh | /**
* Casts a list of unchecked JSON values to a list of checked objects in Java type.
* If the given list contains a value that is not a Map, throws an exception.
*/
@SuppressWarnings("unchecked")
@Override
public List<Map<String, ?>> checkObjectList(List<?> rawList) {
assert rawList != null;
for (int i = ... | 3.26 |
dubbo_AbstractJSONImpl_getListOfStrings_rdh | /**
* Gets a list from an object for the given key, and verifies all entries are strings. If the key
* is not present, this returns null. If the value is not a List or an entry is not a string,
* throws an exception.
*/
@Override
public List<String> getListOfStrings(Map<String, ?> obj, String key) {
assert ob... | 3.26 |
dubbo_AbstractJSONImpl_checkStringList_rdh | /**
* Casts a list of unchecked JSON values to a list of String. If the given list
* contains a value that is not a String, throws an exception.
*/
@SuppressWarnings("unchecked")
@Overridepublic List<String> checkStringList(List<?> rawList) {
assert rawList != null;
for (int i = 0; i < rawList.size(); i++) {... | 3.26 |
dubbo_AbstractJSONImpl_getString_rdh | /**
* Gets a string from an object for the given key. If the key is not present, this returns null.
* If the value is not a String, throws an exception.
*/
@Override
public String
getString(Map<String, ?> obj, String key) {
assert
obj != null;
assert key != null;
if (!obj.containsKey(key)) {retur... | 3.26 |
dubbo_AbstractJSONImpl_getNumberAsDouble_rdh | /**
* Gets a number from an object for the given key. If the key is not present, this returns null.
* If the value does not represent a double, throws an exception.
*/
@Override
public Double getNumberAsDouble(Map<String, ?> obj, String key) {
assert obj != null;
... | 3.26 |
dubbo_AbstractJSONImpl_getObject_rdh | /**
* Gets an object from an object for the given key. If the key is not present, this returns null.
* If the value is not a Map, throws an exception.
*/
@SuppressWarnings("unchecked")
@Override
public Map<String, ?> getObject(Map<String, ?> obj, String key) {
assert obj != null;
assert key !=
null;
... | 3.26 |
dubbo_AbstractJSONImpl_getListOfObjects_rdh | /**
* Gets a list from an object for the given key, and verifies all entries are objects. If the key
* is not present, this returns null. If the value is not a List or an entry is not an object,
* throws an exception.
*/
@Override
public List<Map<String, ?>> getListOfObjects(Map<String, ?> obj, String key) {
... | 3.26 |
dubbo_AbstractJSONImpl_getNumberAsInteger_rdh | /**
* Gets a number from an object for the given key, casted to an integer. If the key is not
* present, this returns null. If the value does not represent an integer, throws an exception.
*/
@Override
public Integer getNumberAsInteger(Map<String, ?> obj, String key) {
assert obj != null;
assert key != nul... | 3.26 |
dubbo_ReferenceCountedResource_close_rdh | /**
* Useful when used together with try-with-resources pattern
*/
@Override
public final void close() {
release();
} | 3.26 |
dubbo_ReferenceCountedResource_retain_rdh | /**
* Increments the reference count by 1.
*/
public final ReferenceCountedResource retain() {
long oldCount = COUNTER_UPDATER.getAndIncrement(this);
if (oldCount <= 0) {COUNTER_UPDATER.getAndDecrement(this);
throw new AssertionError("This instance has been destroyed");
}
return this; } | 3.26 |
dubbo_ReferenceCountedResource_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) {
destroy();
return true;
} else if (remainingCount <= (-... | 3.26 |
dubbo_JavaBeanSerializeUtil_name2Class_rdh | /**
* Transform the Class.forName String to Class Object.
*
* @param name
* Class.getName()
* @return Class
* @throws ClassNotFoundException
* Class.forName
*/
public static Class<?> name2Class(ClassLoader loader, String name) throws ClassNotFoundException {
if (TYPES.containsKey(name)) {
return... | 3.26 |
dubbo_MockClusterInvoker_selectMockInvoker_rdh | /**
* Return MockInvoker
* Contract:
* directory.list() will return a list of normal invokers if Constants.INVOCATION_NEED_MOCK is absent or not true in invocation, otherwise, a list of mock invokers will return.
* if directory.list() returns more than one mock invoker, only one of them will be used.
*
* @param i... | 3.26 |
dubbo_InternalRunnable_Wrap_rdh | /**
* Wrap ordinary Runnable into {@link InternalThreadLocal}.
*/
public static Runnable Wrap(Runnable runnable) {return runnable instanceof InternalRunnable ? runnable :
new InternalRunnable(runnable);
} | 3.26 |
dubbo_DataQueueCommand_getData_rdh | // for test
public byte[] getData() {
return f0;
} | 3.26 |
dubbo_TTree_recursive_rdh | /**
* recursive visit
*/
private void recursive(int deep, boolean isLast, String prefix, Node node, Callback callback) {
callback.callback(deep, isLast, prefix, node);
if (!node.isLeaf()) {
final int size = node.children.size();
for (int index = 0; index < size; index++) {
... | 3.26 |
dubbo_TTree_end_rdh | /**
* end a branch node
*
* @return this
*/
public TTree end() {
if (current.isRoot()) {
throw new IllegalStateException("current node is root.");
}
current.markEnd();
current = current.parent;
return this;
} | 3.26 |
dubbo_TTree_isRoot_rdh | /**
* is the current node the root node
*
* @return true / false
*/
boolean isRoot() {
return
null == parent;
} | 3.26 |
dubbo_TTree_begin_rdh | /**
* create a branch node
*
* @param data
* node data
* @return this
*/
public TTree begin(Object data) {
current = new Node(current, data);
current.markBegin();
return this;
} | 3.26 |
dubbo_WrappedChannelHandler_getPreferredExecutorService_rdh | /**
* Currently, this method is mainly customized to facilitate the thread model on consumer side.
* 1. Use ThreadlessExecutor, aka., delegate callback directly to the thread initiating the call.
* 2. Use shared executor to execute the callback.
*
* @param msg
* @return */
public ... | 3.26 |
dubbo_WrappedChannelHandler_getSharedExecutorService_rdh | /**
* get the shared executor for current Server or Client
*
* @return */
public ExecutorService getSharedExecutorService() {
// Application may be destroyed before channel disconnected, avoid create new application model
// see https://github.com/apache/dubbo/issues/9127
if ((url.getApplicationModel() == null) || ... | 3.26 |
dubbo_MetadataResolver_resolveConsumerServiceMetadata_rdh | /**
* for consumer
*
* @param targetClass
* target service class
* @param url
* consumer url
* @return rest metadata
* @throws CodeStyleNotSupportException
* not support type
*/
public static ServiceRestMetadata resolveConsumerServiceMetadata(Class<?> targetClass, URL url, String contextPathFromUrl) {
... | 3.26 |
dubbo_MD5Utils_getMd5_rdh | /**
* Calculation md5 value of specify string
*
* @param input
*/
public String getMd5(String input) {
byte[] md5;
// MessageDigest instance is NOT thread-safe
synchronized(mdInst) {
mdInst.update(input.getBytes(UTF_8));
md5 = mdInst.digest();
}
int j = md5.length; char str[] =... | 3.26 |
dubbo_SerializingExecutor_execute_rdh | /**
* Runs the given runnable strictly after all Runnables that were submitted
* before it, and using the {@code executor} passed to the constructor. .
*/
@Override
public void execute(Runnable r) {
runQueue.add(r);
schedule(r);
} | 3.26 |
dubbo_CuratorFrameworkParams_getParameterValue_rdh | /**
* Get the parameter value from the specified {@link URL}
*
* @param url
* the Dubbo registry {@link URL}
* @param <T>
* the type of value
* @return the parameter value if present, or return <code>null</code>
*/
public <T> T getParameterValue(URL url) {
String param = url.getParameter(name);
Obje... | 3.26 |
dubbo_InternalThreadLocal_set_rdh | /**
* Sets the value for the current thread.
*/
@Override
public final void set(V value) {if ((value == null) || (value == InternalThreadLocalMap.UNSET)) {
remove();
} else {
InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get();
if (threadLocalMap.setIndexedVariable(index,... | 3.26 |
dubbo_InternalThreadLocal_m0_rdh | /**
* Returns the number of thread local variables bound to the current thread.
*/
public static int m0() {
InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.getIfSet();
if (threadLocalMap == null) {
return 0;
} else {
return threadLocalMap.size();
}
} | 3.26 |
dubbo_InternalThreadLocal_removeAll_rdh | /**
* Removes all {@link InternalThreadLocal} variables bound to the current thread. This operation is useful when you
* are in a container environment, and you don't want to leave the thread local variables in the threads you do not
* manage.
*/
@SuppressWarnings("unchecked")
public static void removeAll()
{
... | 3.26 |
dubbo_InternalThreadLocal_get_rdh | /**
* Returns the current value for the current thread
*/
@SuppressWarnings("unchecked")
@Override
public final V get() {
InternalThreadLocalMap threadLocalMap = InternalThreadLocalMap.get();
Object v = threadLocalMap.indexedVariable(index);
if (v != InternalThreadLocalMap.UNSET) {
return ((V) (v)... | 3.26 |
dubbo_InternalThreadLocal_initialValue_rdh | /**
* Returns the initial value for this thread-local variable.
*/
@Override
protected V initialValue() {
return null;
} | 3.26 |
dubbo_InternalThreadLocal_remove_rdh | /**
* Sets the value to uninitialized for the specified thread local map;
* a proceeding call to get() will trigger a call to initialValue().
* The specified thread local map must be for the current thread.
*/
@SuppressWarnings("unchecked")
public final void remove(InternalThreadLocalMap threadLocalMap) {
if (t... | 3.26 |
dubbo_CtClassBuilder_build_rdh | /**
* build CtClass object
*/
public CtClass build(ClassLoader classLoader) throws NotFoundException, CannotCompileException {
ClassPool pool = new ClassPool(true);
pool.insertClassPath(new LoaderClassPath(classLoader));
pool.insertClassPath(new DubboLoaderClassPath());
// create class
CtClass ct... | 3.26 |
dubbo_CtClassBuilder_getQualifiedClassName_rdh | /**
* get full qualified class name
*
* @param className
* super class name, maybe qualified or not
*/
protected String
getQualifiedClassName(String className) {
if (className.contains(".")) {
return className;
}
if (fullNames.containsKey(className)) {
return fullNames.get(className);... | 3.26 |
dubbo_LFUCache_pollFirst_rdh | /**
* Retrieves and removes the first node of this deque.
*
* @return removed node
*/
CacheNode<K, V> pollFirst() {
CacheNode<K, V> node = null;
if (first.prev != last) {
node = first.prev;
first.prev = node.prev;
fi... | 3.26 |
dubbo_LFUCache_withdrawNode_rdh | /**
* This method takes specified node and reattaches it neighbors nodes
* links to each other, so specified node will no longer tied with them.
* Returns united node, returns null if argument is null.
*
* @param node
* note to retrieve
* @param <K>
* key
* @param <V>
* value
* @return retrieved node
... | 3.26 |
dubbo_LFUCache_proceedEviction_rdh | /**
* Evicts less frequently used elements corresponding to eviction factor,
* specified at instantiation step.
*
* @return number of evicted elements
*/
private int proceedEviction() {
int targetSize = capacity - evictionCount;
int evictedElements = 0;
FREQ_TABLE_ITER_LOOP : for (int i = 0; i <= ca... | 3.26 |
dubbo_LFUCache_addLast_rdh | /**
* Puts the node with specified key and value at the end of the deque
* and returns node.
*
* @param key
* key
* @param value
* value
* @return added node
*/
CacheNode<K, V> addLast(final K key, final V value) {
CacheNode<K, V> node = new CacheNode<>(key,
value);
node.owner = this;
nod... | 3.26 |
dubbo_ValidationFilter_invoke_rdh | /**
* Perform the validation of before invoking the actual method based on <b>validation</b> attribute value.
*
* @param invoker
* service
* @param invocation
* invocation.
* @return Method invocation result
* @throws RpcException
* Throws RpcException if validation failed or any other runtime exception... | 3.26 |
dubbo_ValidationFilter_setValidation_rdh | /**
* Sets the validation instance for ValidationFilter
*
* @param validation
* Validation instance injected by dubbo framework based on "validation" attribute value.
*/
public void setValidation(Validation validation) {
this.validation = validation;
} | 3.26 |
dubbo_RequestHeaderIntercept_intercept_rdh | /**
* resolve method args from header
*/
@Activate(value = RestConstant.REQUEST_HEADER_INTERCEPT, order = Integer.MAX_VALUE - 1)public class RequestHeaderIntercept implements HttpConnectionPreBuildIntercept {
@Override
public void intercept(HttpConnectionCreateContext connectionCreateContext) {
RestMe... | 3.26 |
dubbo_ServiceConfigBase_export_rdh | /**
* export service and auto start application instance
*/
public final void export() {
export(RegisterTypeEnum.AUTO_REGISTER);
} | 3.26 |
dubbo_ServiceConfigBase_setInterfaceClass_rdh | /**
*
* @param interfaceClass
* @see #setInterface(Class)
* @deprecated */
public void setInterfaceClass(Class<?> interfaceClass) {
setInterface(interfaceClass);
} | 3.26 |
dubbo_ServiceConfigBase_register_rdh | /**
* Register delay published service to registry.
*/
public final void register() {
register(false);
} | 3.26 |
dubbo_MemberDescriber_getName_rdh | /**
* Return the name of the member.
*
* @return the name
*/
public String
getName() {
return this.name;
} | 3.26 |
dubbo_PathVariableIntercept_intercept_rdh | /**
* resolve method args from path
*/ @Activate(value = RestConstant.PATH_INTERCEPT, order = 4)public class PathVariableIntercept implements HttpConnectionPreBuildIntercept {
@Override
public void intercept(HttpConnectionCreateContext connectionCreateContext) {
RestMethodMetadata restMethodMetadata =... | 3.26 |
dubbo_BaseServiceMetadata_getDisplayServiceKey_rdh | /**
* Format : interface:version
*
* @return */
public String getDisplayServiceKey() {
StringBuilder serviceNameBuilder = new StringBuilder();
serviceNameBuilder.append(serviceInterfaceName);
serviceNameBuilder.append(COLON_SEPARATOR).append(version);
return serviceNameBuilder.toString();
} | 3.26 |
dubbo_BaseServiceMetadata_revertDisplayServiceKey_rdh | /**
* revert of org.apache.dubbo.common.ServiceDescriptor#getDisplayServiceKey()
*
* @param displayKey
* @return */
public static BaseServiceMetadata revertDisplayServiceKey(String displayKey) {
String[] eles = StringUtils.split(displayKey, COLON_SEPARATOR);
if (((eles == null) || (eles.length < 1)) || (el... | 3.26 |
dubbo_SerializableClassRegistry_registerClass_rdh | /**
* only supposed to be called at startup time
*
* @param clazz
* object type
* @param serializer
* object serializer
*/
public static void registerClass(Class<?>
clazz, Object serializer) {
if (clazz == null) {
throw new IllegalArgumentException("Class registered to kryo cannot be null!");
... | 3.26 |
dubbo_SerializableClassRegistry_getRegisteredClasses_rdh | /**
* get registered classes
*
* @return class serializer
*/
public static Map<Class<?>, Object> getRegisteredClasses() {
return f0;
} | 3.26 |
dubbo_MultipleRegistry_aggregateRegistryUrls_rdh | /**
* Aggregate urls from different registries into one unified list while appending registry specific 'attachments' into each url.
*
* These 'attachments' can be very useful for traffic management among registries.
*
* @param notifyURLs
* unified url list
* @param singleURLs
* single registry url list
* @... | 3.26 |
dubbo_RestServerFactory_createServer_rdh | /**
* Only the server that implements servlet container
* could support something like @Context injection of servlet objects.
*/
public class RestServerFactory {public RestProtocolServer createServer(String name) {
return new NettyHttpRestServer();
}
} | 3.26 |
dubbo_MetadataParamsFilter_instanceParamsExcluded_rdh | /**
* params that need to be excluded before sending to registry center
*
* @return arrays of keys
*/
default String[] instanceParamsExcluded() {return new String[0];
} | 3.26 |
dubbo_HeaderExchangeChannel_close_rdh | // graceful close
@Override
public void close(int timeout) {
if (closed) {
return;}
if (timeout > 0) {
long start = System.currentTimeMillis();
while (DefaultFuture.hasFuture(channel) && ((System.currentTimeMillis() - start) < timeout)) {
try {
Thread.sleep(... | 3.26 |
dubbo_SlidingWindow_isPaneDeprecated_rdh | /**
* Checks if the specified pane is deprecated at the current timestamp.
*
* @param pane
* the specified pane.
* @return true if the pane is deprecated; otherwise false.
*/
public boolean
isPaneDeprecated(final Pane<T> pane) {
return isPaneDeprecated(System.currentTimeMillis(), pane);
} | 3.26 |
dubbo_SlidingWindow_currentPane_rdh | /**
* Get the pane at the specified timestamp in milliseconds.
*
* @param timeMillis
* a timestamp in milliseconds.
* @return the pane at the specified timestamp if the time is valid; null if time is invalid.
*/
public Pane<T> currentPane(long timeMillis) {
if (timeMillis < 0) {
return null;
}
... | 3.26 |
dubbo_SlidingWindow_calculatePaneStart_rdh | /**
* Calculate the pane start corresponding to the specified timestamp.
*
* @param timeMillis
* the specified timestamp.
* @return the pane start corresponding to the specified timestamp.
*/
protected long calculatePaneStart(long timeMillis) {
return timeMillis - (timeMillis % paneIntervalInMs);
} | 3.26 |
dubbo_SlidingWindow_calculatePaneIdx_rdh | /**
* Calculate the pane index corresponding to the specified timestamp.
*
* @param timeMillis
* the specified timestamp.
* @return the pane index corresponding to the specified timestamp.
*/
private int calculatePaneIdx(long timeMillis) {
return ((int) ((timeMillis / paneIntervalInMs) % paneCount));
} | 3.26 |
dubbo_SlidingWindow_values_rdh | /**
* Get aggregated value list for entire sliding window at the specified time.
* The list will only contain value from "valid" panes.
*
* @return aggregated value list for entire sliding window.
*/
public List<T> values(long timeMillis) {
if (timeMillis < 0) {
return new ArrayList<>();
}
List... | 3.26 |
dubbo_SlidingWindow_list_rdh | /**
* Get valid pane list for entire sliding window at the specified time.
* The list will only contain "valid" panes.
*
* @param timeMillis
* the specified time.
* @return valid pane list for entire sliding window.
*/
public List<Pane<T>> list(long timeMillis) {
if (timeMillis < 0) {return new ArrayList<... | 3.26 |
dubbo_SlidingWindow_getPaneValue_rdh | /**
* Get statistic value from pane at the specified timestamp.
*
* @param timeMillis
* the specified timestamp in milliseconds.
* @return the statistic value if pane at the specified timestamp is up-to-date; otherwise null.
*/
public T
getPaneValue(long timeMillis) {
if (timeMillis < 0) {
return nu... | 3.26 |
dubbo_AdaptiveClassCodeGenerator_generateMethodThrows_rdh | /**
* generate method throws
*/
private String generateMethodThrows(Method method) {
Class<?>[] ets = method.getExceptionTypes();
if (ets.length > 0) {
String v14 = Arrays.stream(ets).map(Class::getCanonicalName).collect(Collectors.joining(", "));
return String.format(CODE_METHOD_THROWS, v14... | 3.26 |
dubbo_AdaptiveClassCodeGenerator_generateMethod_rdh | /**
* generate method declaration
*/
private String generateMethod(Method method) {
String methodReturnType = method.getReturnType().getCanonicalName();
String methodName = method.getName();
String methodContent = generateMethodContent(method);
String methodArgs = generateMethodArguments(method);
... | 3.26 |
dubbo_AdaptiveClassCodeGenerator_generatePackageInfo_rdh | /**
* generate package info
*/
private String generatePackageInfo() {
return String.format(CODE_PACKAGE, type.getPackage().getName());
} | 3.26 |
dubbo_AdaptiveClassCodeGenerator_generateExtNameAssignment_rdh | /**
* generate extName assignment code
*/
private String generateExtNameAssignment(String[] value, boolean hasInvocation) {// TODO: refactor it
String getNameCode = null;
for (int i = value.length - 1; i >= 0; --i) {
if (i ==
(value.length - 1)) {
if (null != defaultExtName) {if (!... | 3.26 |
dubbo_AdaptiveClassCodeGenerator_generateMethodContent_rdh | /**
* generate method content
*/
private String
generateMethodContent(Method method) {
Adaptive adaptiveAnnotation = method.getAnnotation(Adaptive.class);
StringBuilder code = new StringBuilder(512);
if (adapt... | 3.26 |
dubbo_AdaptiveClassCodeGenerator_generateMethodArguments_rdh | /**
* generate method arguments
*/
private String generateMethodArguments(Method method) {
Class<?>[] v12 = method.getParameterTypes();
return IntStream.range(0, v12.length).mapToObj(i
-> String.format(CODE_METHOD_ARGUMENT, v12[i].getCanonicalName(), i)).collect(Collectors.joining(", "));
} | 3.26 |
dubbo_AdaptiveClassCodeGenerator_generateInvocationArgumentNullCheck_rdh | /**
* generate code to test argument of type <code>Invocation</code> is null
*/
private String generateInvocationArgumentNullCheck(Method method) {
Class<?>[] pts = method.getParameterTypes();
return IntStream.range(0,
pts.length).filter(i -> CLASS_NAME_INVOCATION.equals(pts[i].getName())).ma... | 3.26 |
dubbo_AdaptiveClassCodeGenerator_m0_rdh | /**
* generate and return class code
*
* @param sort
* - whether sort methods
*/
public String m0(boolean sort) {
// no need to generate adaptive class since there's no adaptive method found.
if (!hasAdaptiveMethod()) { throw new IllegalStateException(("No adaptive method exist on extension " + type.get... | 3.26 |
dubbo_AdaptiveClassCodeGenerator_generateUrlAssignmentIndirectly_rdh | /**
* get parameter with type <code>URL</code> from method parameter:
* <p>
* test if parameter has method which returns type <code>URL</code>
* <p>
* if not found, throws IllegalStateException
*/
private String generateUrlAssignmentIndirectly(Method method) {
Class<?>[] pts = method.getParameterTypes();
... | 3.26 |
dubbo_AdaptiveClassCodeGenerator_generateUrlNullCheck_rdh | /**
* generate method URL argument null check
*/
private String generateUrlNullCheck(int index) {
return String.format(CODE_URL_NULL_CHECK, index, URL.class.getName(), index);
} | 3.26 |
dubbo_AdaptiveClassCodeGenerator_m1_rdh | /**
* generate method invocation statement and return it if necessary
*/
private String m1(Method method) {
String returnStatement = (method.getReturnType().equals(void.class)) ? "" : "return ";
String args = IntStream.range(0, method.getParameters().length).mapToObj(i -> String.format(f0, i)).collect(Collec... | 3.26 |
dubbo_AdaptiveClassCodeGenerator_getMethodAdaptiveValue_rdh | /**
* get value of adaptive annotation or if empty return splitted simple name
*/
private String[] getMethodAdaptiveValue(Adaptive adaptiveAnnotation) {
String[]
value = adaptiveAnnotation.value();
... | 3.26 |
dubbo_AdaptiveClassCodeGenerator_generateImports_rdh | /**
* generate imports
*/
private String generateImports() {
StringBuilder builder = new StringBuilder();
builder.append(String.format(CODE_IMPORTS, ScopeModel.class.getName()));builder.append(String.format(CODE_IMPORTS, ScopeModelUtil.class.getName()));
return builder.toString();
} | 3.26 |
dubbo_AdaptiveClassCodeGenerator_generateScopeModelAssignment_rdh | /**
*
* @return */
private String generateScopeModelAssignment() {
return String.format(CODE_SCOPE_MODEL_ASSIGNMENT, type.getName());
} | 3.26 |
dubbo_AdaptiveClassCodeGenerator_getUrlTypeIndex_rdh | /**
* get index of parameter with type URL
*/
private int getUrlTypeIndex(Method method) {
int urlTypeIndex = -1;
Class<?>[] pts = method.getParameterTypes();
for (int
i = 0; i < pts.length; ++i) {
if (pts[i].equals(URL.class)) {
urlTypeIndex = i;break;
}
}
return ... | 3.26 |
dubbo_AdaptiveClassCodeGenerator_generate_rdh | /**
* generate and return class code
*/
public String generate() {
return this.m0(false);
} | 3.26 |
dubbo_Environment_getConfigurationMaps_rdh | /**
* Get global configuration as map list
*
* @return */
public List<Map<String, String>> getConfigurationMaps() {
if (f1 == null) {
f1 = getConfigurationMaps(null, null);
}
return f1;
} | 3.26 |
dubbo_Environment_getConfiguration_rdh | /**
* There are two ways to get configuration during exposure / reference or at runtime:
* 1. URL, The value in the URL is relatively fixed. we can get value directly.
* 2. The configuration exposed in this method is convenient for us to query the latest values from multiple
* prioritized sources, it also guarantee... | 3.26 |
dubbo_Environment_reset_rdh | /**
* Reset environment.
* For test only.
*/
public void reset() {
destroy();
initialize();} | 3.26 |
dubbo_Environment_loadMigrationRule_rdh | /**
*
* @deprecated MigrationRule will be removed in 3.1
*/
@Deprecatedprivate void loadMigrationRule() {
if (Boolean.parseBoolean(System.getProperty(CommonConstants.DUBBO_MIGRATION_FILE_ENABLE, "false"))) {
String path = System.getProperty(CommonConstants.DUBBO_MIGRATION_KEY);
if (StringUtils.i... | 3.26 |
dubbo_Environment_updateAppConfigMap_rdh | /**
* Merge target map properties into app configuration
*
* @param map
*/
public void updateAppConfigMap(Map<String, String> map) {
this.appConfiguration.addProperties(map);
} | 3.26 |
dubbo_Environment_getPrefixedConfiguration_rdh | /**
* At start-up, Dubbo is driven by various configuration, such as Application, Registry, Protocol, etc.
* All configurations will be converged into a data bus - URL, and then drive the subsequent process.
* <p>
* At present, there are many configuration sources, including AbstractConfig (API, XML, annotation), -... | 3.26 |
dubbo_NettyHttpHandler_executeFilters_rdh | /**
* execute rest filters
*
* @param restFilterContext
* @param restFilters
* @throws Exception
*/
public void executeFilters(RestFilterContext restFilterContext, List<RestFilter> restFilters) throws Exception {
for (RestFilter restFilter : restFilters) {restFilter.filter(restFilterContext);
if (res... | 3.26 |
dubbo_UrlUtils_m0_rdh | /**
* Get the all serializations,ensure insertion order
*
* @param url
* url
* @return {@link List}<{@link String}>
*/
@SuppressWarnings("unchecked")
public static Collection<String> m0(URL url) {
// preferSerialization -> serialization -> default serialization
Set<String> serializations = new LinkedHas... | 3.26 |
dubbo_UrlUtils_preferSerialization_rdh | /**
* Prefer Serialization
*
* @param url
* url
* @return {@link List}<{@link String}>
*/
public static List<String> preferSerialization(URL url) {
String preferSerialization = url.getParameter(PREFER_SERIALIZATION_KEY);
if (StringUtils.isNotBlank(preferSerialization)) {
return Collections.unmod... | 3.26 |
dubbo_UrlUtils_serializationOrDefault_rdh | /**
* Get the serialization or default serialization
*
* @param url
* url
* @return {@link String}
*/
public static String
serializationOrDefault(URL url) {
// noinspection OptionalGetWithoutIsPresent
Optional<String> serializations = m0(url).stream().findFirst();return serializations.orElseGet(DefaultS... | 3.26 |
dubbo_UrlUtils_serializationId_rdh | /**
* Get the serialization id
*
* @param url
* url
* @return {@link Byte}
*/
public static Byte serializationId(URL url) {
Byte serializationId;
// Obtain the value from prefer_serialization. Such as.fastjson2,hessian2
List<String> preferSerials = preferSerialization(url);
for (String preferSer... | 3.26 |
dubbo_ZookeeperDynamicConfiguration_getInternalProperty_rdh | /**
*
* @param key
* e.g., {service}.configurators, {service}.tagrouters, {group}.dubbo.properties
* @return */
@Override
public String getInternalProperty(String key) {
return zkClient.getContent(buildPathKey("", key));
} | 3.26 |
dubbo_ServiceBeanNameBuilder_create_rdh | /**
*
* @param attributes
* @param defaultInterfaceClass
* @param environment
* @return * @since 2.7.3
*/public static ServiceBeanNameBuilder create(AnnotationAttributes attributes, Class<?> defaultInterfaceClass, Environment environment) {
return new ServiceBeanNameBuilder(attributes, defaultInterfaceClass,... | 3.26 |
dubbo_ApplicationModel_ofNullable_rdh | // --------- static methods ----------//
public static ApplicationModel
ofNullable(ApplicationModel applicationModel) {
if (applicationModel != null) {
return
applicationModel;
} else {
return defaultModel();
}
} | 3.26 |
dubbo_ApplicationModel_getEnvironment_rdh | /**
*
* @deprecated Replace to {@link ScopeModel#modelEnvironment()}
*/
@Deprecated
public static Environment getEnvironment() {
return defaultModel().m0();
}
/**
*
* @deprecated Replace to {@link ApplicationModel#getApplicationConfigManager()} | 3.26 |
dubbo_ApplicationModel_getConsumerModel_rdh | /**
*
* @deprecated ConsumerModel should fetch from context
*/
@Deprecated
public static ConsumerModel getConsumerModel(String serviceKey) {
return defaultModel().getDefaultModule().getServiceRepository().lookupReferredService(serviceKey);
} | 3.26 |
dubbo_ApplicationModel_getName_rdh | /**
*
* @deprecated Replace to {@link ApplicationModel#getApplicationName()}
*/
@Deprecated
public static String getName() {
return defaultModel().getCurrentConfig().getName();
} | 3.26 |
dubbo_ApplicationModel_allConsumerModels_rdh | // =============================== Deprecated Methods Start =======================================
/**
*
* @deprecated use {@link ServiceRepository#allConsumerModels()}
*/
@Deprecated
public static Collection<ConsumerModel> allConsumerModels() {
return defaultModel().getApplicationServiceRepository().allConsumerMo... | 3.26 |
dubbo_ApplicationModel_setServiceRepository_rdh | /**
*
* @deprecated only for ut
*/
@Deprecated
public void setServiceRepository(ServiceRepository serviceRepository) {
this.serviceRepository = serviceRepository;
} | 3.26 |
dubbo_ApplicationModel_setEnvironment_rdh | /**
*
* @deprecated only for ut
*/
@Deprecated
public void
setEnvironment(Environment environment) {
this.environment = environment;
} | 3.26 |
dubbo_ApplicationModel_getExecutorRepository_rdh | /**
*
* @deprecated Replace to {@link ApplicationModel#getApplicationExecutorRepository()}
*/
@Deprecated
public static ExecutorRepository getExecutorRepository() {
return defaultModel().getApplicationExecutorRepository();
}
/**
*
* @deprecated Replace to {@link ApplicationModel#getCurrentConfig()} | 3.26 |
dubbo_ApplicationModel_allProviderModels_rdh | /**
*
* @deprecated use {@link ServiceRepository#allProviderModels()}
*/
@Deprecated
public static Collection<ProviderModel> allProviderModels() {
return defaultModel().getApplicationServiceRepository().allProviderModels();
} | 3.26 |
dubbo_ApplicationModel_setConfigManager_rdh | /**
*
* @deprecated only for ut
*/
@Deprecated
public void setConfigManager(ConfigManager configManager) {
this.configManager = configManager;
} | 3.26 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.