idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
21,700 | public static < K , V > void initOrAddList ( Map < K , List < V > > orginMap , K key , V needAdd ) { List < V > listeners = orginMap . get ( key ) ; if ( listeners == null ) { listeners = new CopyOnWriteArrayList < V > ( ) ; listeners . add ( needAdd ) ; orginMap . put ( key , listeners ) ; } else { listeners . add ( needAdd ) ; } } | Init or add list . |
21,701 | protected ProviderInfo selectPinpointProvider ( String targetIP , List < ProviderInfo > providerInfos ) { ProviderInfo tp = ProviderHelper . toProviderInfo ( targetIP ) ; for ( ProviderInfo providerInfo : providerInfos ) { if ( providerInfo . getHost ( ) . equals ( tp . getHost ( ) ) && StringUtils . equals ( providerInfo . getProtocolType ( ) , tp . getProtocolType ( ) ) && providerInfo . getPort ( ) == tp . getPort ( ) ) { return providerInfo ; } } return null ; } | Select provider . |
21,702 | void updateProviders ( ConsumerConfig config , List < Instance > instances ) { if ( LOGGER . isInfoEnabled ( config . getAppName ( ) ) ) { LOGGER . infoWithApp ( config . getAppName ( ) , "Receive update provider: serviceName={}, size={}, data={}" , config . getInterfaceId ( ) , instances . size ( ) , instances ) ; } List < ProviderInfoListener > providerInfoListeners = providerListenerMap . get ( config ) ; if ( CommonUtils . isNotEmpty ( providerInfoListeners ) ) { List < ProviderInfo > providerInfos = NacosRegistryHelper . convertInstancesToProviders ( instances ) ; List < ProviderInfo > matchProviders = RegistryUtils . matchProviderInfos ( config , providerInfos ) ; for ( ProviderInfoListener providerInfoListener : providerInfoListeners ) { providerInfoListener . updateAllProviders ( Collections . singletonList ( new ProviderGroup ( ) . addAll ( matchProviders ) ) ) ; } } } | Update providers . |
21,703 | protected String getTargetServiceName ( Object request ) { if ( request instanceof RequestBase ) { RequestBase requestBase = ( RequestBase ) request ; return requestBase . getTargetServiceUniqueName ( ) ; } return null ; } | Get target service name from request |
21,704 | public String getMessage ( ) { final int maxTipLength = 10 ; int end = position + 1 ; int start = end - maxTipLength ; if ( start < 0 ) { start = 0 ; } if ( end > jsonString . length ( ) ) { end = jsonString . length ( ) ; } return String . format ( "%s (%d):%s" , jsonString . substring ( start , end ) , position , super . getMessage ( ) ) ; } | Get message about error when parsing illegal json |
21,705 | protected List < ProviderGroup > subscribeFromDirectUrl ( String directUrl ) { List < ProviderGroup > result = new ArrayList < ProviderGroup > ( ) ; List < ProviderInfo > tmpProviderInfoList = new ArrayList < ProviderInfo > ( ) ; String [ ] providerStrs = StringUtils . splitWithCommaOrSemicolon ( directUrl ) ; for ( String providerStr : providerStrs ) { ProviderInfo providerInfo = convertToProviderInfo ( providerStr ) ; if ( providerInfo . getStaticAttr ( ProviderInfoAttrs . ATTR_SOURCE ) == null ) { providerInfo . setStaticAttr ( ProviderInfoAttrs . ATTR_SOURCE , "direct" ) ; } tmpProviderInfoList . add ( providerInfo ) ; } result . add ( new ProviderGroup ( RpcConstants . ADDRESS_DIRECT_GROUP , tmpProviderInfoList ) ) ; return result ; } | Subscribe provider list from direct url |
21,706 | protected List < ProviderGroup > subscribeFromRegistries ( ) { List < ProviderGroup > result = new ArrayList < ProviderGroup > ( ) ; List < RegistryConfig > registryConfigs = consumerConfig . getRegistry ( ) ; if ( CommonUtils . isEmpty ( registryConfigs ) ) { return result ; } int addressWaitTime = consumerConfig . getAddressWait ( ) ; int maxAddressWaitTime = SofaConfigs . getIntegerValue ( consumerConfig . getAppName ( ) , SofaOptions . CONFIG_MAX_ADDRESS_WAIT_TIME , SofaOptions . MAX_ADDRESS_WAIT_TIME ) ; addressWaitTime = addressWaitTime < 0 ? maxAddressWaitTime : Math . min ( addressWaitTime , maxAddressWaitTime ) ; ProviderInfoListener listener = consumerConfig . getProviderInfoListener ( ) ; respondRegistries = addressWaitTime == 0 ? null : new CountDownLatch ( registryConfigs . size ( ) ) ; Map < String , ProviderGroup > tmpProviderInfoList = new HashMap < String , ProviderGroup > ( ) ; for ( RegistryConfig registryConfig : registryConfigs ) { Registry registry = RegistryFactory . getRegistry ( registryConfig ) ; registry . init ( ) ; registry . start ( ) ; try { List < ProviderGroup > current ; try { if ( respondRegistries != null ) { consumerConfig . setProviderInfoListener ( new WrapperClusterProviderInfoListener ( listener , respondRegistries ) ) ; } current = registry . subscribe ( consumerConfig ) ; } finally { if ( respondRegistries != null ) { consumerConfig . setProviderInfoListener ( listener ) ; } } if ( current == null ) { continue ; } else { if ( respondRegistries != null ) { respondRegistries . countDown ( ) ; } } for ( ProviderGroup group : current ) { String groupName = group . getName ( ) ; if ( ! group . isEmpty ( ) ) { ProviderGroup oldGroup = tmpProviderInfoList . get ( groupName ) ; if ( oldGroup != null ) { oldGroup . addAll ( group . getProviderInfos ( ) ) ; } else { tmpProviderInfoList . put ( groupName , group ) ; } } } } catch ( SofaRpcRuntimeException e ) { throw e ; } catch ( Throwable e ) { String appName = consumerConfig . getAppName ( ) ; if ( LOGGER . isWarnEnabled ( appName ) ) { LOGGER . warnWithApp ( appName , "Catch exception when subscribe from registry: " + registryConfig . getId ( ) + ", but you can ignore if it's called by JVM shutdown hook" , e ) ; } } } if ( respondRegistries != null ) { try { respondRegistries . await ( addressWaitTime , TimeUnit . MILLISECONDS ) ; } catch ( Exception ignore ) { } } return new ArrayList < ProviderGroup > ( tmpProviderInfoList . values ( ) ) ; } | Subscribe provider list from all registries the providers will be merged . |
21,707 | public static void destroyAll ( ) { for ( Map . Entry < ServerConfig , ProtocolConfig > entry : SERVER_MAP . entrySet ( ) ) { entry . getValue ( ) . destory ( ) ; } try { ProtocolConfig . destroyAll ( ) ; } catch ( Exception e ) { } } | Destroy all dubbo resources |
21,708 | public static void compareGroup ( ProviderGroup oldGroup , ProviderGroup newGroup , List < ProviderInfo > add , List < ProviderInfo > remove ) { compareProviders ( oldGroup . getProviderInfos ( ) , newGroup . getProviderInfos ( ) , add , remove ) ; } | Compare two provider group return add list and remove list |
21,709 | public static void compareProviders ( List < ProviderInfo > oldList , List < ProviderInfo > newList , List < ProviderInfo > add , List < ProviderInfo > remove ) { if ( CommonUtils . isEmpty ( oldList ) ) { if ( CommonUtils . isNotEmpty ( newList ) ) { add . addAll ( newList ) ; } } else { if ( CommonUtils . isEmpty ( newList ) ) { remove . addAll ( oldList ) ; } else { if ( CommonUtils . isNotEmpty ( oldList ) ) { List < ProviderInfo > tmpList = new ArrayList < ProviderInfo > ( newList ) ; for ( ProviderInfo oldProvider : oldList ) { if ( tmpList . contains ( oldProvider ) ) { tmpList . remove ( oldProvider ) ; } else { remove . add ( oldProvider ) ; } } add . addAll ( tmpList ) ; } } } } | Compare two provider list return add list and remove list |
21,710 | public static void compareGroups ( List < ProviderGroup > oldGroups , List < ProviderGroup > newGroups , List < ProviderInfo > add , List < ProviderInfo > remove ) { if ( CommonUtils . isEmpty ( oldGroups ) ) { if ( CommonUtils . isNotEmpty ( newGroups ) ) { for ( ProviderGroup newGroup : newGroups ) { add . addAll ( newGroup . getProviderInfos ( ) ) ; } } } else { if ( CommonUtils . isEmpty ( newGroups ) ) { for ( ProviderGroup oldGroup : oldGroups ) { remove . addAll ( oldGroup . getProviderInfos ( ) ) ; } } else { if ( CommonUtils . isNotEmpty ( oldGroups ) ) { Map < String , List < ProviderInfo > > oldMap = convertToMap ( oldGroups ) ; Map < String , List < ProviderInfo > > mapTmp = convertToMap ( newGroups ) ; for ( Map . Entry < String , List < ProviderInfo > > oldEntry : oldMap . entrySet ( ) ) { String key = oldEntry . getKey ( ) ; List < ProviderInfo > oldList = oldEntry . getValue ( ) ; if ( mapTmp . containsKey ( key ) ) { final List < ProviderInfo > newList = mapTmp . remove ( key ) ; compareProviders ( oldList , newList , add , remove ) ; mapTmp . remove ( key ) ; } else { remove . addAll ( oldList ) ; } } for ( Map . Entry < String , List < ProviderInfo > > entry : mapTmp . entrySet ( ) ) { add . addAll ( entry . getValue ( ) ) ; } } } } } | Compare two provider group list return add list and remove list |
21,711 | public static String toUrl ( ProviderInfo providerInfo ) { String uri = providerInfo . getProtocolType ( ) + "://" + providerInfo . getHost ( ) + ":" + providerInfo . getPort ( ) ; uri += StringUtils . trimToEmpty ( providerInfo . getPath ( ) ) ; StringBuilder sb = new StringBuilder ( ) ; if ( providerInfo . getRpcVersion ( ) > 0 ) { sb . append ( "&" ) . append ( ProviderInfoAttrs . ATTR_RPC_VERSION ) . append ( "=" ) . append ( providerInfo . getRpcVersion ( ) ) ; } if ( providerInfo . getSerializationType ( ) != null ) { sb . append ( "&" ) . append ( ProviderInfoAttrs . ATTR_SERIALIZATION ) . append ( "=" ) . append ( providerInfo . getSerializationType ( ) ) ; } for ( Map . Entry < String , String > entry : providerInfo . getStaticAttrs ( ) . entrySet ( ) ) { sb . append ( "&" ) . append ( entry . getKey ( ) ) . append ( "=" ) . append ( entry . getValue ( ) ) ; } if ( sb . length ( ) > 0 ) { uri += sb . replace ( 0 , 1 , "?" ) . toString ( ) ; } return uri ; } | Write provider info to url string |
21,712 | public static long parseLong ( String num , long defaultLong ) { if ( num == null ) { return defaultLong ; } else { try { return Long . parseLong ( num ) ; } catch ( Exception e ) { return defaultLong ; } } } | String Long turn number . |
21,713 | protected Url convertProviderToUrl ( ClientTransportConfig transportConfig , ProviderInfo providerInfo ) { Url boltUrl = new Url ( providerInfo . toString ( ) , providerInfo . getHost ( ) , providerInfo . getPort ( ) ) ; boltUrl . setConnectTimeout ( transportConfig . getConnectTimeout ( ) ) ; final int connectionNum = transportConfig . getConnectionNum ( ) ; if ( connectionNum > 0 ) { boltUrl . setConnNum ( connectionNum ) ; } else { boltUrl . setConnNum ( 1 ) ; } boltUrl . setConnWarmup ( false ) ; if ( RpcConstants . PROTOCOL_TYPE_BOLT . equals ( providerInfo . getProtocolType ( ) ) ) { boltUrl . setProtocol ( RemotingConstants . PROTOCOL_BOLT ) ; } else { boltUrl . setProtocol ( RemotingConstants . PROTOCOL_TR ) ; } return boltUrl ; } | For convert provider to bolt url . |
21,714 | public S setApplication ( ApplicationConfig application ) { if ( application == null ) { application = new ApplicationConfig ( ) ; } this . application = application ; return castThis ( ) ; } | Sets application . |
21,715 | public S setMethods ( List < MethodConfig > methods ) { if ( this . methods == null ) { this . methods = new ConcurrentHashMap < String , MethodConfig > ( ) ; } if ( methods != null ) { for ( MethodConfig methodConfig : methods ) { this . methods . put ( methodConfig . getName ( ) , methodConfig ) ; } } return castThis ( ) ; } | Sets methods . |
21,716 | static List < Instance > convertProviderToInstances ( ProviderConfig providerConfig ) { @ SuppressWarnings ( "unchecked" ) List < ServerConfig > servers = providerConfig . getServer ( ) ; if ( servers != null && ! servers . isEmpty ( ) ) { List < Instance > instances = new ArrayList < Instance > ( ) ; for ( ServerConfig server : servers ) { Instance instance = new Instance ( ) ; instance . setClusterName ( DEFAULT_CLUSTER ) ; instance . setServiceName ( providerConfig . getInterfaceId ( ) ) ; String host = server . getVirtualHost ( ) ; if ( host == null ) { host = server . getHost ( ) ; if ( NetUtils . isLocalHost ( host ) || NetUtils . isAnyHost ( host ) ) { host = SystemInfo . getLocalHost ( ) ; } } instance . setIp ( host ) ; instance . setPort ( server . getPort ( ) ) ; Map < String , String > metaData = RegistryUtils . convertProviderToMap ( providerConfig , server ) ; instance . setMetadata ( metaData ) ; instances . add ( instance ) ; } return instances ; } return null ; } | Convert provider to instances list . |
21,717 | static List < ProviderInfo > convertInstancesToProviders ( List < Instance > allInstances ) { List < ProviderInfo > providerInfos = new ArrayList < ProviderInfo > ( ) ; if ( CommonUtils . isEmpty ( allInstances ) ) { return providerInfos ; } for ( Instance instance : allInstances ) { String url = convertInstanceToUrl ( instance ) ; ProviderInfo providerInfo = ProviderHelper . toProviderInfo ( url ) ; providerInfos . add ( providerInfo ) ; } return providerInfos ; } | Convert instances to providers list . |
21,718 | public void addProviderListener ( ConsumerConfig consumerConfig , ProviderInfoListener listener ) { if ( listener != null ) { RegistryUtils . initOrAddList ( providerListenerMap , consumerConfig , listener ) ; } } | Add provider listener . |
21,719 | public void putHeadCache ( Short key , String value ) { if ( headerCache == null ) { synchronized ( this ) { if ( headerCache == null ) { headerCache = new TwoWayMap < Short , String > ( ) ; } } } if ( headerCache != null && ! headerCache . containsKey ( key ) ) { headerCache . put ( key , value ) ; } } | Put header cache |
21,720 | public void invalidateHeadCache ( Byte key , String value ) { if ( headerCache != null && headerCache . containsKey ( key ) ) { String old = headerCache . get ( key ) ; if ( ! old . equals ( value ) ) { throw new SofaRpcRuntimeException ( "Value of old is not match current" ) ; } headerCache . remove ( key ) ; } } | Invalidate head cache . |
21,721 | private void configureClearTextWithPriorKnowledge ( SocketChannel ch ) { ch . pipeline ( ) . addLast ( connectionHandler , new PrefaceFrameWrittenEventHandler ( ) , new UserEventLogger ( ) ) ; configureEndOfPipeline ( ch . pipeline ( ) ) ; } | Configure the pipeline for a cleartext useing Prior - Knowledge method to start http2 . |
21,722 | protected void checkParameters ( ) { Class proxyClass = providerConfig . getProxyClass ( ) ; String key = providerConfig . buildKey ( ) ; T ref = providerConfig . getRef ( ) ; if ( ! proxyClass . isInstance ( ref ) ) { throw ExceptionUtils . buildRuntime ( "provider.ref" , ref == null ? "null" : ref . getClass ( ) . getName ( ) , "This is not an instance of " + providerConfig . getInterfaceId ( ) + " in provider config with key " + key + " !" ) ; } if ( CommonUtils . isEmpty ( providerConfig . getServer ( ) ) ) { throw ExceptionUtils . buildRuntime ( "server" , "NULL" , "Value of \"server\" is not specified in provider" + " config with key " + key + " !" ) ; } checkMethods ( proxyClass ) ; } | for check fields and parameters of consumer config |
21,723 | public static boolean recoverWeight ( ProviderInfo providerInfo , int weight ) { providerInfo . setStatus ( ProviderStatus . RECOVERING ) ; providerInfo . setWeight ( weight ) ; return true ; } | Recover weight of provider info |
21,724 | public static boolean degradeWeight ( ProviderInfo providerInfo , int weight ) { providerInfo . setStatus ( ProviderStatus . DEGRADED ) ; providerInfo . setWeight ( weight ) ; return true ; } | Degrade weight of provider info |
21,725 | public static void recoverOriginWeight ( ProviderInfo providerInfo , int originWeight ) { providerInfo . setStatus ( ProviderStatus . AVAILABLE ) ; providerInfo . setWeight ( originWeight ) ; } | Recover weight of provider info and set default status |
21,726 | private static int [ ] readUncompressedLength ( byte [ ] compressed , int compressedOffset ) throws CorruptionException { int result ; int bytesRead = 0 ; { int b = compressed [ compressedOffset + bytesRead ++ ] & 0xFF ; result = b & 0x7f ; if ( ( b & 0x80 ) != 0 ) { b = compressed [ compressedOffset + bytesRead ++ ] & 0xFF ; result |= ( b & 0x7f ) << 7 ; if ( ( b & 0x80 ) != 0 ) { b = compressed [ compressedOffset + bytesRead ++ ] & 0xFF ; result |= ( b & 0x7f ) << 14 ; if ( ( b & 0x80 ) != 0 ) { b = compressed [ compressedOffset + bytesRead ++ ] & 0xFF ; result |= ( b & 0x7f ) << 21 ; if ( ( b & 0x80 ) != 0 ) { b = compressed [ compressedOffset + bytesRead ++ ] & 0xFF ; result |= ( b & 0x7f ) << 28 ; if ( ( b & 0x80 ) != 0 ) { throw new CorruptionException ( "last byte of compressed length int has high bit set" ) ; } } } } } } return new int [ ] { result , bytesRead } ; } | Reads the variable length integer encoded a the specified offset and returns this length with the number of bytes read . |
21,727 | public ServerConfig setPort ( int port ) { if ( ! NetUtils . isRandomPort ( port ) && NetUtils . isInvalidPort ( port ) ) { throw ExceptionUtils . buildRuntime ( "server.port" , port + "" , "port must between -1 and 65535 (-1 means random port)" ) ; } this . port = port ; return this ; } | Sets port . |
21,728 | public ServerConfig setContextPath ( String contextPath ) { if ( ! contextPath . endsWith ( StringUtils . CONTEXT_SEP ) ) { contextPath += StringUtils . CONTEXT_SEP ; } this . contextPath = contextPath ; return this ; } | Sets context path . |
21,729 | public static BufferRecycler instance ( ) { SoftReference < BufferRecycler > ref = recyclerRef . get ( ) ; BufferRecycler bufferRecycler ; if ( ref == null ) { bufferRecycler = null ; } else { bufferRecycler = ref . get ( ) ; } if ( bufferRecycler == null ) { bufferRecycler = new BufferRecycler ( ) ; recyclerRef . set ( new SoftReference < BufferRecycler > ( bufferRecycler ) ) ; } return bufferRecycler ; } | Accessor to get thread - local recycler instance |
21,730 | public static ClientTransport getReverseClientTransport ( String channelKey ) { return REVERSE_CLIENT_TRANSPORT_MAP != null ? REVERSE_CLIENT_TRANSPORT_MAP . get ( channelKey ) : null ; } | Find reverse client transport by channel key |
21,731 | boolean isProtoBufMessageObject ( Object object ) { if ( object == null ) { return false ; } if ( MULTIPLE_CLASSLOADER ) { return object instanceof MessageLite || isProtoBufMessageClass ( object . getClass ( ) ) ; } else { return object instanceof MessageLite ; } } | Is this object instanceof MessageLite |
21,732 | public RpcInternalContext setLocalAddress ( String host , int port ) { if ( host == null ) { return this ; } if ( port < 0 || port > 0xFFFF ) { port = 0 ; } this . localAddress = InetSocketAddress . createUnresolved ( host , port ) ; return this ; } | set local address . |
21,733 | public RpcInternalContext setRemoteAddress ( String host , int port ) { if ( host == null ) { return this ; } if ( port < 0 || port > 0xFFFF ) { port = 0 ; } this . remoteAddress = InetSocketAddress . createUnresolved ( host , port ) ; return this ; } | set remote address . |
21,734 | public Object getAttachment ( String key ) { return key == null ? null : attachments . get ( key ) ; } | get attachment . |
21,735 | public RpcInternalContext setAttachment ( String key , Object value ) { if ( key == null ) { return this ; } if ( ! ATTACHMENT_ENABLE ) { if ( ! isHiddenParamKey ( key ) ) { return this ; } } else { if ( ! isValidInternalParamKey ( key ) ) { throw new IllegalArgumentException ( "key must start with" + RpcConstants . INTERNAL_KEY_PREFIX + " or " + RpcConstants . HIDE_KEY_PREFIX ) ; } } if ( value == null ) { attachments . remove ( key ) ; } else { attachments . put ( key , value ) ; } return this ; } | set attachment . |
21,736 | public void clear ( ) { this . setRemoteAddress ( null ) . setLocalAddress ( null ) . setFuture ( null ) . setProviderSide ( null ) . setProviderInfo ( null ) ; this . attachments = new ConcurrentHashMap < String , Object > ( ) ; this . stopWatch . reset ( ) ; } | Clear context for next user |
21,737 | static void overrideBlackList ( List < String > originList , String overrideStr ) { List < String > adds = new ArrayList < String > ( ) ; String [ ] overrideItems = StringUtils . splitWithCommaOrSemicolon ( overrideStr ) ; for ( String overrideItem : overrideItems ) { if ( StringUtils . isNotBlank ( overrideItem ) ) { if ( overrideItem . startsWith ( "!" ) || overrideItem . startsWith ( "-" ) ) { overrideItem = overrideItem . substring ( 1 ) ; if ( "*" . equals ( overrideItem ) || "default" . equals ( overrideItem ) ) { originList . clear ( ) ; } else { originList . remove ( overrideItem ) ; } } else { if ( ! originList . contains ( overrideItem ) ) { adds . add ( overrideItem ) ; } } } } if ( adds . size ( ) > 0 ) { originList . addAll ( adds ) ; } } | Override blacklist with override string . |
21,738 | public void collectServer ( RpcServerLookoutModel rpcServerMetricsModel ) { try { Id methodProviderId = createMethodProviderId ( rpcServerMetricsModel ) ; MixinMetric methodProviderMetric = Lookout . registry ( ) . mixinMetric ( methodProviderId ) ; recordCounterAndTimer ( methodProviderMetric , rpcServerMetricsModel ) ; } catch ( Throwable t ) { LOGGER . error ( LogCodes . getLog ( LogCodes . ERROR_METRIC_REPORT_ERROR ) , t ) ; } } | Collect the RPC server information . |
21,739 | public void collectThreadPool ( ServerConfig serverConfig , final ThreadPoolExecutor threadPoolExecutor ) { try { int coreSize = serverConfig . getCoreThreads ( ) ; int maxSize = serverConfig . getMaxThreads ( ) ; int queueSize = serverConfig . getQueues ( ) ; final ThreadPoolConfig threadPoolConfig = new ThreadPoolConfig ( coreSize , maxSize , queueSize ) ; Lookout . registry ( ) . info ( rpcLookoutId . fetchServerThreadConfigId ( serverConfig ) , new Info < ThreadPoolConfig > ( ) { public ThreadPoolConfig value ( ) { return threadPoolConfig ; } } ) ; Lookout . registry ( ) . gauge ( rpcLookoutId . fetchServerThreadPoolActiveCountId ( serverConfig ) , new Gauge < Integer > ( ) { public Integer value ( ) { return threadPoolExecutor . getActiveCount ( ) ; } } ) ; Lookout . registry ( ) . gauge ( rpcLookoutId . fetchServerThreadPoolIdleCountId ( serverConfig ) , new Gauge < Integer > ( ) { public Integer value ( ) { return threadPoolExecutor . getPoolSize ( ) - threadPoolExecutor . getActiveCount ( ) ; } } ) ; Lookout . registry ( ) . gauge ( rpcLookoutId . fetchServerThreadPoolQueueSizeId ( serverConfig ) , new Gauge < Integer > ( ) { public Integer value ( ) { return threadPoolExecutor . getQueue ( ) . size ( ) ; } } ) ; } catch ( Throwable t ) { LOGGER . error ( LogCodes . getLog ( LogCodes . ERROR_METRIC_REPORT_ERROR ) , t ) ; } } | Collect the thread pool information |
21,740 | public void removeThreadPool ( ServerConfig serverConfig ) { Lookout . registry ( ) . removeMetric ( rpcLookoutId . removeServerThreadConfigId ( serverConfig ) ) ; Lookout . registry ( ) . removeMetric ( rpcLookoutId . removeServerThreadPoolActiveCountId ( serverConfig ) ) ; Lookout . registry ( ) . removeMetric ( rpcLookoutId . removeServerThreadPoolIdleCountId ( serverConfig ) ) ; Lookout . registry ( ) . removeMetric ( rpcLookoutId . removeServerThreadPoolQueueSizeId ( serverConfig ) ) ; } | remove the thread pool information |
21,741 | private void recordCounterAndTimer ( MixinMetric mixinMetric , RpcAbstractLookoutModel model ) { Counter totalCounter = mixinMetric . counter ( "total_count" ) ; Timer totalTimer = mixinMetric . timer ( "total_time" ) ; Long elapsedTime = model . getElapsedTime ( ) ; totalCounter . inc ( ) ; if ( elapsedTime != null ) { totalTimer . record ( elapsedTime , TimeUnit . MILLISECONDS ) ; } if ( ! model . getSuccess ( ) ) { Counter failCounter = mixinMetric . counter ( "fail_count" ) ; Timer failTimer = mixinMetric . timer ( "fail_time" ) ; failCounter . inc ( ) ; if ( elapsedTime != null ) { failTimer . record ( elapsedTime , TimeUnit . MILLISECONDS ) ; } } } | Record the number of calls and time consuming . |
21,742 | private void recordSize ( MixinMetric mixinMetric , RpcClientLookoutModel model ) { Long requestSize = model . getRequestSize ( ) ; Long responseSize = model . getResponseSize ( ) ; if ( requestSize != null ) { DistributionSummary requestSizeDS = mixinMetric . distributionSummary ( "request_size" ) ; requestSizeDS . record ( model . getRequestSize ( ) ) ; } if ( responseSize != null ) { DistributionSummary responseSizeDS = mixinMetric . distributionSummary ( "response_size" ) ; responseSizeDS . record ( model . getResponseSize ( ) ) ; } } | Record request size and response size |
21,743 | private Id createMethodConsumerId ( RpcClientLookoutModel model ) { Map < String , String > tags = new HashMap < String , String > ( 6 ) ; tags . put ( "app" , StringUtils . defaultString ( model . getApp ( ) ) ) ; tags . put ( "service" , StringUtils . defaultString ( model . getService ( ) ) ) ; tags . put ( "method" , StringUtils . defaultString ( model . getMethod ( ) ) ) ; tags . put ( "protocol" , StringUtils . defaultString ( model . getProtocol ( ) ) ) ; tags . put ( "invoke_type" , StringUtils . defaultString ( model . getInvokeType ( ) ) ) ; tags . put ( "target_app" , StringUtils . defaultString ( model . getTargetApp ( ) ) ) ; return rpcLookoutId . fetchConsumerStatId ( ) . withTags ( tags ) ; } | Create consumer id |
21,744 | public Id createMethodProviderId ( RpcServerLookoutModel model ) { Map < String , String > tags = new HashMap < String , String > ( 5 ) ; tags . put ( "app" , StringUtils . defaultString ( model . getApp ( ) ) ) ; tags . put ( "service" , StringUtils . defaultString ( model . getService ( ) ) ) ; tags . put ( "method" , StringUtils . defaultString ( model . getMethod ( ) ) ) ; tags . put ( "protocol" , StringUtils . defaultString ( model . getProtocol ( ) ) ) ; tags . put ( "caller_app" , StringUtils . defaultString ( model . getCallerApp ( ) ) ) ; return rpcLookoutId . fetchProviderStatId ( ) . withTags ( tags ) ; } | Create provider id |
21,745 | protected SerializerFactory getSerializerFactory ( boolean multipleClassLoader , boolean generic ) { if ( generic ) { return multipleClassLoader ? new GenericMultipleClassLoaderSofaSerializerFactory ( ) : new GenericSingleClassLoaderSofaSerializerFactory ( ) ; } else { return multipleClassLoader ? new MultipleClassLoaderSofaSerializerFactory ( ) : new SingleClassLoaderSofaSerializerFactory ( ) ; } } | Gets serializer factory . |
21,746 | public static < T > ExtensionLoader < T > getExtensionLoader ( Class < T > clazz , ExtensionLoaderListener < T > listener ) { ExtensionLoader < T > loader = LOADER_MAP . get ( clazz ) ; if ( loader == null ) { synchronized ( ExtensionLoaderFactory . class ) { loader = LOADER_MAP . get ( clazz ) ; if ( loader == null ) { loader = new ExtensionLoader < T > ( clazz , listener ) ; LOADER_MAP . put ( clazz , loader ) ; } } } return loader ; } | Get extension loader by extensible class with listener |
21,747 | public static < T > ExtensionLoader < T > getExtensionLoader ( Class < T > clazz ) { return getExtensionLoader ( clazz , null ) ; } | Get extension loader by extensible class without listener |
21,748 | public String getId ( ) { if ( id == null ) { synchronized ( this ) { if ( id == null ) { id = "rpc-cfg-" + ID_GENERATOR . getAndIncrement ( ) ; } } } return id ; } | Gets id . |
21,749 | public static long hash ( byte [ ] digest , int index ) { long f = ( ( long ) ( digest [ 3 + index * 4 ] & 0xFF ) << 24 ) | ( ( long ) ( digest [ 2 + index * 4 ] & 0xFF ) << 16 ) | ( ( long ) ( digest [ 1 + index * 4 ] & 0xFF ) << 8 ) | ( digest [ index * 4 ] & 0xFF ) ; return f & 0xFFFFFFFFL ; } | Hash long . |
21,750 | protected ApplicationInfoRequest buildApplicationRequest ( String appName ) { ApplicationInfoRequest applicationInfoRequest = new ApplicationInfoRequest ( ) ; applicationInfoRequest . setAppName ( appName ) ; return applicationInfoRequest ; } | can be extended |
21,751 | protected void recoverRegistryData ( ) { for ( ProviderConfig providerConfig : providerUrls . keySet ( ) ) { registerProviderUrls ( providerConfig ) ; } for ( ConsumerConfig consumerConfig : consumerUrls . keySet ( ) ) { subscribeConsumerUrls ( consumerConfig ) ; } } | recover data when connect with zk again . |
21,752 | private static int writeUncompressedLength ( byte [ ] compressed , int compressedOffset , int uncompressedLength ) { int highBitMask = 0x80 ; if ( uncompressedLength < ( 1 << 7 ) && uncompressedLength >= 0 ) { compressed [ compressedOffset ++ ] = ( byte ) ( uncompressedLength ) ; } else if ( uncompressedLength < ( 1 << 14 ) && uncompressedLength > 0 ) { compressed [ compressedOffset ++ ] = ( byte ) ( uncompressedLength | highBitMask ) ; compressed [ compressedOffset ++ ] = ( byte ) ( uncompressedLength >>> 7 ) ; } else if ( uncompressedLength < ( 1 << 21 ) && uncompressedLength > 0 ) { compressed [ compressedOffset ++ ] = ( byte ) ( uncompressedLength | highBitMask ) ; compressed [ compressedOffset ++ ] = ( byte ) ( ( uncompressedLength >>> 7 ) | highBitMask ) ; compressed [ compressedOffset ++ ] = ( byte ) ( uncompressedLength >>> 14 ) ; } else if ( uncompressedLength < ( 1 << 28 ) && uncompressedLength > 0 ) { compressed [ compressedOffset ++ ] = ( byte ) ( uncompressedLength | highBitMask ) ; compressed [ compressedOffset ++ ] = ( byte ) ( ( uncompressedLength >>> 7 ) | highBitMask ) ; compressed [ compressedOffset ++ ] = ( byte ) ( ( uncompressedLength >>> 14 ) | highBitMask ) ; compressed [ compressedOffset ++ ] = ( byte ) ( uncompressedLength >>> 21 ) ; } else { compressed [ compressedOffset ++ ] = ( byte ) ( uncompressedLength | highBitMask ) ; compressed [ compressedOffset ++ ] = ( byte ) ( ( uncompressedLength >>> 7 ) | highBitMask ) ; compressed [ compressedOffset ++ ] = ( byte ) ( ( uncompressedLength >>> 14 ) | highBitMask ) ; compressed [ compressedOffset ++ ] = ( byte ) ( ( uncompressedLength >>> 21 ) | highBitMask ) ; compressed [ compressedOffset ++ ] = ( byte ) ( uncompressedLength >>> 28 ) ; } return compressedOffset ; } | Writes the uncompressed length as variable length integer . |
21,753 | public ProviderConfig < T > setServer ( ServerConfig server ) { if ( this . server == null ) { this . server = new ArrayList < ServerConfig > ( ) ; } this . server . add ( server ) ; return this ; } | add server . |
21,754 | protected void addAlive ( ProviderInfo providerInfo , ClientTransport transport ) { if ( checkState ( providerInfo , transport ) ) { aliveConnections . put ( providerInfo , transport ) ; } } | Add alive . |
21,755 | public static < T extends Enum < T > > T getEnumValue ( String primaryKey , Class < T > enumClazz ) { String val = ( String ) CFG . get ( primaryKey ) ; if ( val == null ) { throw new SofaRpcRuntimeException ( "Not Found Key: " + primaryKey ) ; } else { return Enum . valueOf ( enumClazz , val ) ; } } | Gets enum value . |
21,756 | public static List getListValue ( String primaryKey ) { List val = ( List ) CFG . get ( primaryKey ) ; if ( val == null ) { throw new SofaRpcRuntimeException ( "Not found key: " + primaryKey ) ; } else { return val ; } } | Gets list value . |
21,757 | public static < T > T getOrDefaultValue ( String primaryKey , T defaultValue ) { Object val = CFG . get ( primaryKey ) ; return val == null ? defaultValue : ( T ) CompatibleTypeUtils . convert ( val , defaultValue . getClass ( ) ) ; } | Gets or default value . |
21,758 | public int getWeight ( ) { ProviderStatus status = getStatus ( ) ; if ( status == ProviderStatus . WARMING_UP ) { try { Integer warmUpWeight = ( Integer ) getDynamicAttr ( ProviderInfoAttrs . ATTR_WARMUP_WEIGHT ) ; if ( warmUpWeight != null ) { return warmUpWeight ; } } catch ( Exception e ) { return weight ; } } return weight ; } | Gets weight . |
21,759 | public ProviderStatus getStatus ( ) { if ( status == ProviderStatus . WARMING_UP ) { if ( System . currentTimeMillis ( ) > ( Long ) getDynamicAttr ( ProviderInfoAttrs . ATTR_WARM_UP_END_TIME ) ) { status = ProviderStatus . AVAILABLE ; setDynamicAttr ( ProviderInfoAttrs . ATTR_WARM_UP_END_TIME , null ) ; } } return status ; } | Gets status . |
21,760 | public void onAsyncResponse ( ConsumerConfig config , SofaRequest request , SofaResponse response , Throwable throwable ) throws SofaRpcException { try { for ( Filter loadedFilter : loadedFilters ) { loadedFilter . onAsyncResponse ( config , request , response , throwable ) ; } } catch ( SofaRpcException e ) { LOGGER . errorWithApp ( config . getAppName ( ) , "Catch exception when do filtering after asynchronous respond." , e ) ; } } | Do filtering when async respond from server |
21,761 | public static void parseTraceKey ( Map < String , String > tracerMap , String key , String value ) { String lowKey = key . substring ( PREFIX . length ( ) ) ; String realKey = TRACER_KEY_MAP . get ( lowKey ) ; tracerMap . put ( realKey == null ? lowKey : realKey , value ) ; } | Parse tracer key |
21,762 | public Object getResponseProp ( String key ) { return responseProps == null ? null : responseProps . get ( key ) ; } | Gets response prop . |
21,763 | public void addResponseProp ( String key , String value ) { if ( responseProps == null ) { responseProps = new HashMap < String , String > ( 16 ) ; } if ( key != null && value != null ) { responseProps . put ( key , value ) ; } } | Add response prop . |
21,764 | public void removeResponseProp ( String key ) { if ( responseProps != null && key != null ) { responseProps . remove ( key ) ; } } | Remove response props . |
21,765 | public static Invoker parseInvoker ( Object proxyObject ) { InvocationHandler handler = java . lang . reflect . Proxy . getInvocationHandler ( proxyObject ) ; if ( handler instanceof JDKInvocationHandler ) { return ( ( JDKInvocationHandler ) handler ) . getProxyInvoker ( ) ; } return null ; } | Parse proxy invoker from proxy object |
21,766 | public int getOriginWeight ( ) { if ( originWeight == null ) { if ( providerInfo == null ) { originWeight = RpcConfigs . getIntValue ( RpcOptions . PROVIDER_WEIGHT ) ; } else { originWeight = CommonUtils . parseInt ( providerInfo . getStaticAttr ( ProviderInfoAttrs . ATTR_WEIGHT ) , RpcConfigs . getIntValue ( RpcOptions . PROVIDER_WEIGHT ) ) ; } } return originWeight ; } | Gets origin weight . |
21,767 | void notifyConsumer ( Map < String , ProviderGroup > newCache ) { Map < String , ProviderGroup > oldCache = memoryCache ; MapDifference < String , ProviderGroup > difference = new MapDifference < String , ProviderGroup > ( newCache , oldCache ) ; Map < String , ProviderGroup > onlynew = difference . entriesOnlyOnLeft ( ) ; for ( Map . Entry < String , ProviderGroup > entry : onlynew . entrySet ( ) ) { notifyConsumerListeners ( entry . getKey ( ) , entry . getValue ( ) ) ; } Map < String , ProviderGroup > onlyold = difference . entriesOnlyOnRight ( ) ; for ( Map . Entry < String , ProviderGroup > entry : onlyold . entrySet ( ) ) { notifyConsumerListeners ( entry . getKey ( ) , new ProviderGroup ( ) ) ; } Map < String , ValueDifference < ProviderGroup > > changed = difference . entriesDiffering ( ) ; for ( Map . Entry < String , ValueDifference < ProviderGroup > > entry : changed . entrySet ( ) ) { if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "{} has differente" , entry . getKey ( ) ) ; } ValueDifference < ProviderGroup > differentValue = entry . getValue ( ) ; ProviderGroup innew = differentValue . leftValue ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "new(right) is {}" , innew ) ; } notifyConsumerListeners ( entry . getKey ( ) , innew ) ; } } | Notify consumer . |
21,768 | public Object getRequestProp ( String key ) { return requestProps != null ? requestProps . get ( key ) : null ; } | Gets request prop . |
21,769 | public void addRequestProp ( String key , Object value ) { if ( key == null || value == null ) { return ; } if ( requestProps == null ) { requestProps = new HashMap < String , Object > ( 16 ) ; } requestProps . put ( key , value ) ; } | Add request prop . |
21,770 | public void removeRequestProp ( String key ) { if ( key == null ) { return ; } if ( requestProps != null ) { requestProps . remove ( key ) ; } } | Remove request prop . |
21,771 | public void addRequestProps ( Map < String , Object > map ) { if ( map == null || map . isEmpty ( ) ) { return ; } if ( requestProps == null ) { requestProps = new HashMap < String , Object > ( 16 ) ; } requestProps . putAll ( map ) ; } | Add request props . |
21,772 | public String getMethodInvokeType ( String methodName ) { return ( String ) getMethodConfigValue ( methodName , RpcConstants . CONFIG_KEY_INVOKE_TYPE , getInvokeType ( ) ) ; } | Gets the call type corresponding to the method name |
21,773 | public static boolean isAssignableFrom ( Class < ? > interfaceClass , Class < ? > implementClass ) { if ( interfaceClass . isAssignableFrom ( implementClass ) ) { return true ; } String interfaceName = interfaceClass . getCanonicalName ( ) ; return implementClass . getCanonicalName ( ) . equals ( interfaceName ) || isImplementOrSubclass ( interfaceName , implementClass ) ; } | The isAssignableFrom method which can cross multiple classloader . |
21,774 | public static < A extends Annotation > Optional < A > findPropertyAnnotation ( BeanPropertyDefinition beanPropertyDefinition , Class < A > annotationClass ) { return tryGetFieldAnnotation ( beanPropertyDefinition , annotationClass ) . map ( Optional :: of ) . orElse ( tryGetGetterAnnotation ( beanPropertyDefinition , annotationClass ) ) . map ( Optional :: of ) . orElse ( tryGetSetterAnnotation ( beanPropertyDefinition , annotationClass ) ) ; } | Finds first annotation of the given type on the given bean property and returns it . Search precedence is getter setter field . |
21,775 | public static ModelContext inputParam ( String group , Type type , DocumentationType documentationType , AlternateTypeProvider alternateTypeProvider , GenericTypeNamingStrategy genericNamingStrategy , Set < Class > ignorableTypes ) { return new ModelContext ( group , type , false , documentationType , alternateTypeProvider , genericNamingStrategy , ignorableTypes ) ; } | Convenience method to provide an new context for an input parameter |
21,776 | public static ModelContext returnValue ( String groupName , Type type , DocumentationType documentationType , AlternateTypeProvider alternateTypeProvider , GenericTypeNamingStrategy genericNamingStrategy , Set < Class > ignorableTypes ) { return new ModelContext ( groupName , type , true , documentationType , alternateTypeProvider , genericNamingStrategy , ignorableTypes ) ; } | Convenience method to provide an new context for an return parameter |
21,777 | public boolean hasSeenBefore ( ResolvedType resolvedType ) { return seenTypes . contains ( resolvedType ) || seenTypes . contains ( new TypeResolver ( ) . resolve ( resolvedType . getErasedType ( ) ) ) || parentHasSeenBefore ( resolvedType ) ; } | Answers the question has the given type been processed? |
21,778 | public void apply ( ModelPropertyContext context ) { Optional < NotNull > notNull = extractAnnotation ( context ) ; if ( notNull . isPresent ( ) ) { context . getBuilder ( ) . required ( notNull . isPresent ( ) ) ; } } | read NotNull annotation |
21,779 | public static < T > T defaultIfAbsent ( T newValue , T defaultValue ) { return ofNullable ( newValue ) . orElse ( ofNullable ( defaultValue ) . orElse ( null ) ) ; } | Returns this default value if the new value is null |
21,780 | public static < T > List < T > nullToEmptyList ( Collection < T > newValue ) { if ( newValue == null ) { return new ArrayList < > ( ) ; } return new ArrayList < > ( newValue ) ; } | Returns an empty list if the newValue is null |
21,781 | public static < T > Set < T > nullToEmptySet ( Set < T > newValue ) { if ( newValue == null ) { return new HashSet < > ( ) ; } return newValue ; } | Returns an empty set if the newValue is null |
21,782 | public static AllowableValues emptyToNull ( AllowableValues newValue , AllowableValues current ) { if ( newValue != null ) { if ( newValue instanceof AllowableListValues ) { return defaultIfAbsent ( emptyListValuesToNull ( ( AllowableListValues ) newValue ) , current ) ; } else { return defaultIfAbsent ( newValue , current ) ; } } return current ; } | Retains current allowable values if then new value is null |
21,783 | public Docket additionalModels ( ResolvedType first , ResolvedType ... remaining ) { additionalModels . add ( first ) ; additionalModels . addAll ( Arrays . stream ( remaining ) . collect ( toSet ( ) ) ) ; return this ; } | Method to add additional models that are not part of any annotation or are perhaps implicit |
21,784 | public Docket tags ( Tag first , Tag ... remaining ) { tags . add ( first ) ; tags . addAll ( Arrays . stream ( remaining ) . collect ( toSet ( ) ) ) ; return this ; } | Method to add global tags to the docket |
21,785 | public ApiListingBuilder produces ( Set < String > mediaTypes ) { if ( mediaTypes != null ) { this . produces = new HashSet < > ( mediaTypes ) ; } return this ; } | Replaces the existing media types with new entries that this documentation produces |
21,786 | public ApiListingBuilder consumes ( Set < String > mediaTypes ) { if ( mediaTypes != null ) { this . consumes = new HashSet < > ( mediaTypes ) ; } return this ; } | Replaces the existing media types with new entries that this documentation consumes |
21,787 | public ApiListingBuilder securityReferences ( List < SecurityReference > securityReferences ) { if ( securityReferences != null ) { this . securityReferences = new ArrayList < > ( securityReferences ) ; } return this ; } | Updates the references to the security definitions |
21,788 | public ApiListingBuilder apis ( List < ApiDescription > apis ) { if ( apis != null ) { this . apis = apis . stream ( ) . sorted ( descriptionOrdering ) . collect ( toList ( ) ) ; } return this ; } | Updates the apis |
21,789 | public ApiListingBuilder models ( Map < String , Model > models ) { this . models . putAll ( nullToEmptyMap ( models ) ) ; return this ; } | Adds to the models collection |
21,790 | public ApiListingBuilder availableTags ( Set < Tag > availableTags ) { this . tagLookup . putAll ( nullToEmptySet ( availableTags ) . stream ( ) . collect ( toMap ( Tag :: getName , identity ( ) ) ) ) ; return this ; } | Globally configured tags |
21,791 | public static Predicate < String > regex ( final String pathRegex ) { return new Predicate < String > ( ) { public boolean test ( String input ) { return input . matches ( pathRegex ) ; } } ; } | Predicate that evaluates the supplied regular expression |
21,792 | public static Predicate < String > ant ( final String antPattern ) { return new Predicate < String > ( ) { public boolean test ( String input ) { AntPathMatcher matcher = new AntPathMatcher ( ) ; return matcher . match ( antPattern , input ) ; } } ; } | Predicate that evaluates the supplied ant pattern |
21,793 | public ModelBuilder properties ( Map < String , ModelProperty > properties ) { this . properties . putAll ( nullToEmptyMap ( properties ) ) ; return this ; } | Updates the model properties |
21,794 | public ModelBuilder subTypes ( List < ModelReference > subTypes ) { if ( subTypes != null ) { this . subTypes . addAll ( subTypes ) ; } return this ; } | Updates the subclasses for this model . |
21,795 | public DocumentationBuilder apiListingsByResourceGroupName ( Map < String , List < ApiListing > > apiListings ) { nullToEmptyMultimap ( apiListings ) . entrySet ( ) . stream ( ) . forEachOrdered ( entry -> { List < ApiListing > list ; if ( this . apiListings . containsKey ( entry . getKey ( ) ) ) { list = this . apiListings . get ( entry . getKey ( ) ) ; list . addAll ( entry . getValue ( ) ) ; } else { list = new ArrayList < > ( entry . getValue ( ) ) ; this . apiListings . put ( entry . getKey ( ) , list ) ; } list . sort ( byListingPosition ( ) ) ; } ) ; return this ; } | Updates the map with new entries |
21,796 | protected Set < ResponseMessage > read ( OperationContext context ) { Set < ResponseMessage > ret ; try { PathMatchingResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver ( ) ; Resource [ ] resources = resourceResolver . getResources ( "classpath*:" + context . getName ( ) + "*/http-response.springfox" ) ; ret = Arrays . stream ( resources ) . map ( toRawHttpResponse ( ) ) . filter ( Objects :: nonNull ) . collect ( Collectors . collectingAndThen ( toMap ( RawHttpResponse :: getStatusCode , mappingResponseToResponseMessageBuilder ( ) , mergingExamples ( ) ) , responseMessagesMap -> responseMessagesMap . values ( ) . stream ( ) . map ( ResponseMessageBuilder :: build ) . collect ( Collectors . toSet ( ) ) ) ) ; } catch ( Exception e ) { LOG . warn ( "Failed to read restdocs example for {} " + context . getName ( ) + " caused by: " + e . toString ( ) ) ; ret = Collections . emptySet ( ) ; } return ret ; } | Provides response messages with examples for given single operation context . |
21,797 | public List < SecurityReference > securityForPath ( String path ) { if ( selector . test ( path ) ) { return securityReferences ; } return new ArrayList < SecurityReference > ( ) ; } | Use securityForOperation instead |
21,798 | public ResolvedType alternateFor ( ResolvedType type ) { if ( appliesTo ( type ) ) { if ( hasWildcards ( original ) ) { return replaceWildcardsFrom ( WildcardType . collectReplaceables ( type , original ) , alternate ) ; } else { return alternate ; } } return type ; } | Provides alternate for supplier type . |
21,799 | public boolean appliesTo ( ResolvedType type ) { return hasWildcards ( original ) && wildcardMatch ( type , original ) || exactMatch ( original , type ) ; } | Check if an alternate applies to type . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.