├── .aci.yml ├── .github ├── ISSUE_TEMPLATE │ ├── Ask_Question.md │ ├── Bug_Report.md │ └── feature_request.md ├── PULL_REQUEST_TEMPLATE.md └── workflows │ ├── integration-test.yml │ ├── pmd.yml │ └── unit-test.yml ├── .gitignore ├── .travis.yml ├── LICENSE ├── Makefile ├── README.md ├── README_ZH.md ├── SECURITY.md ├── VERSION ├── appveyor.yml ├── client ├── all │ └── pom.xml ├── api │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── alipay │ │ │ └── sofa │ │ │ └── registry │ │ │ └── client │ │ │ └── api │ │ │ ├── ConfigDataObserver.java │ │ │ ├── Configurator.java │ │ │ ├── EventBus.java │ │ │ ├── EventSubscriber.java │ │ │ ├── Publisher.java │ │ │ ├── Register.java │ │ │ ├── RegistryClient.java │ │ │ ├── RegistryClientConfig.java │ │ │ ├── Subscriber.java │ │ │ ├── SubscriberDataObserver.java │ │ │ ├── exception │ │ │ ├── DuplicateException.java │ │ │ └── RegistryClientException.java │ │ │ ├── model │ │ │ ├── ConfigData.java │ │ │ ├── Event.java │ │ │ ├── RegistryType.java │ │ │ └── UserData.java │ │ │ └── registration │ │ │ ├── BaseRegistration.java │ │ │ ├── ConfiguratorRegistration.java │ │ │ ├── PublisherRegistration.java │ │ │ └── SubscriberRegistration.java │ │ └── test │ │ └── java │ │ └── com │ │ └── alipay │ │ └── sofa │ │ └── registry │ │ ├── client │ │ └── api │ │ │ ├── exception │ │ │ ├── DuplicateExceptionTest.java │ │ │ └── RegistryClientExceptionTest.java │ │ │ └── registration │ │ │ ├── BaseRegistrationTest.java │ │ │ ├── ConfiguratorRegistrationTest.java │ │ │ ├── PublisherRegistrationTest.java │ │ │ └── SubscriberRegistrationTest.java │ │ └── core │ │ └── model │ │ ├── ReceivedConfigDataTest.java │ │ ├── ReceivedDataTest.java │ │ ├── ResultTest.java │ │ └── ScopeEnumTest.java ├── impl │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── alipay │ │ │ │ └── sofa │ │ │ │ └── registry │ │ │ │ └── client │ │ │ │ ├── auth │ │ │ │ ├── AuthManager.java │ │ │ │ └── NoopAuthManager.java │ │ │ │ ├── constants │ │ │ │ ├── ValueConstants.java │ │ │ │ └── VersionConstants.java │ │ │ │ ├── event │ │ │ │ ├── ConfiguratorProcessEvent.java │ │ │ │ ├── DefaultEventBus.java │ │ │ │ ├── LookoutSubscriber.java │ │ │ │ └── SubscriberProcessEvent.java │ │ │ │ ├── factory │ │ │ │ └── NamedThreadFactory.java │ │ │ │ ├── model │ │ │ │ ├── ConfiguratorData.java │ │ │ │ └── SegmentData.java │ │ │ │ ├── provider │ │ │ │ ├── AbstractInternalRegister.java │ │ │ │ ├── DefaultConfigData.java │ │ │ │ ├── DefaultConfigurator.java │ │ │ │ ├── DefaultObserverHandler.java │ │ │ │ ├── DefaultPublisher.java │ │ │ │ ├── DefaultRegistryClient.java │ │ │ │ ├── DefaultRegistryClientConfig.java │ │ │ │ ├── DefaultRegistryClientConfigBuilder.java │ │ │ │ ├── DefaultServerManager.java │ │ │ │ ├── DefaultServerNode.java │ │ │ │ ├── DefaultSubscriber.java │ │ │ │ ├── DefaultUserData.java │ │ │ │ ├── DirectServerManager.java │ │ │ │ └── RegisterCache.java │ │ │ │ ├── remoting │ │ │ │ ├── Client.java │ │ │ │ ├── ClientConnection.java │ │ │ │ ├── ClientConnectionCloseEventProcessor.java │ │ │ │ ├── ClientConnectionOpenEventProcessor.java │ │ │ │ ├── ReceivedConfigDataProcessor.java │ │ │ │ ├── ReceivedDataProcessor.java │ │ │ │ ├── ServerManager.java │ │ │ │ └── ServerNode.java │ │ │ │ ├── task │ │ │ │ ├── AbstractWorkerThread.java │ │ │ │ ├── ObserverHandler.java │ │ │ │ ├── SyncConfigThread.java │ │ │ │ ├── TaskEvent.java │ │ │ │ ├── TaskQueue.java │ │ │ │ ├── Worker.java │ │ │ │ └── WorkerThread.java │ │ │ │ └── util │ │ │ │ ├── CommonUtils.java │ │ │ │ ├── HttpClientUtils.java │ │ │ │ ├── ServerNodeParser.java │ │ │ │ └── StringUtils.java │ │ └── resources │ │ │ └── com │ │ │ └── alipay │ │ │ └── sofa │ │ │ └── registry │ │ │ └── client │ │ │ └── log │ │ │ ├── log4j │ │ │ └── log-conf.xml │ │ │ ├── log4j2 │ │ │ └── log-conf.xml │ │ │ └── logback │ │ │ └── log-conf.xml │ │ └── test │ │ └── java │ │ └── com │ │ └── alipay │ │ └── sofa │ │ └── registry │ │ └── client │ │ ├── MockServer.java │ │ ├── base │ │ └── BaseTest.java │ │ ├── event │ │ ├── DefaultEventBusTest.java │ │ ├── LookoutSubscriberTest.java │ │ ├── TestEvent.java │ │ └── TestEventSubscriber.java │ │ ├── model │ │ └── ConfiguratorDataTest.java │ │ ├── provider │ │ ├── DefaultObserverHandlerTest.java │ │ ├── DefaultRegistryClientConfigTest.java │ │ ├── DefaultRegistryClientTest.java │ │ ├── DefaultServerManagerTest.java │ │ ├── DefaultSubscriberTest.java │ │ ├── DirectServerManagerTest.java │ │ └── RegisterOrderTest.java │ │ ├── remoting │ │ ├── ReceivedConfigDataProcessorTest.java │ │ └── ReceivedDataProcessorTest.java │ │ ├── task │ │ ├── SyncConfigThreadTest.java │ │ └── TaskEventTest.java │ │ └── util │ │ ├── CommonUtilsTest.java │ │ ├── HttpClientUtilsTest.java │ │ ├── ServerNodeParserTest.java │ │ └── StringUtilsTest.java ├── log │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── alipay │ │ │ └── sofa │ │ │ └── registry │ │ │ └── client │ │ │ └── log │ │ │ └── LoggerFactory.java │ │ └── test │ │ └── java │ │ └── com │ │ └── alipay │ │ └── sofa │ │ └── registry │ │ └── client │ │ └── log │ │ └── LoggerFactoryTest.java └── pom.xml ├── codecov.yml ├── core ├── pom.xml └── src │ ├── main │ └── java │ │ └── com │ │ └── alipay │ │ └── sofa │ │ └── registry │ │ └── core │ │ ├── constants │ │ ├── AttributeKeyConstants.java │ │ └── EventTypeConstants.java │ │ └── model │ │ ├── AppRevisionInterface.java │ │ ├── BaseRegister.java │ │ ├── ConfiguratorRegister.java │ │ ├── DataBox.java │ │ ├── MultiReceivedData.java │ │ ├── MultiSegmentData.java │ │ ├── PublisherRegister.java │ │ ├── ReceivedConfigData.java │ │ ├── ReceivedData.java │ │ ├── RegisterResponse.java │ │ ├── Result.java │ │ ├── ScopeEnum.java │ │ ├── SubscriberRegister.java │ │ ├── SyncConfigRequest.java │ │ └── SyncConfigResponse.java │ └── test │ └── java │ └── com │ └── alipay │ └── sofa │ └── registry │ └── core │ ├── constants │ └── EventTypeConstantsTest.java │ └── model │ ├── BaseRegisterTest.java │ ├── RegisterResponseTest.java │ └── ResultTest.java ├── create_table.sql ├── docker ├── Dockerfile ├── compose │ ├── README.md │ ├── init │ │ └── init.sql │ └── sofa-registry-in-docker-compose.yml └── kube │ ├── mysql-deployment.yaml │ └── sofa-registry │ ├── base-integration │ ├── configmap.yaml │ ├── db-secret.yaml │ ├── integration.yaml │ └── kustomization.yaml │ ├── base-standalone │ ├── configmap.yaml │ ├── data.yaml │ ├── db-secret.yaml │ ├── kustomization.yaml │ ├── meta.yaml │ └── session.yaml │ └── overlays │ ├── integration-dc1 │ ├── configmap-patch.yaml │ ├── db-secret-patch.yaml │ ├── integration-patch.yaml │ └── kustomization.yaml │ └── standalone-dc2 │ ├── configmap-patch.yaml │ ├── data-patch.yaml │ ├── db-secret-patch.yaml │ ├── kustomization.yaml │ ├── meta-patch.yaml │ └── session-patch.yaml ├── pom.xml ├── ruleset.xml ├── server ├── common │ ├── model │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── alipay │ │ │ │ │ └── sofa │ │ │ │ │ └── registry │ │ │ │ │ └── common │ │ │ │ │ └── model │ │ │ │ │ ├── ClientOffPublishers.java │ │ │ │ │ ├── CollectionSdks.java │ │ │ │ │ ├── CommonResponse.java │ │ │ │ │ ├── ConnectId.java │ │ │ │ │ ├── DataCenterPushInfo.java │ │ │ │ │ ├── DataUtils.java │ │ │ │ │ ├── ElementType.java │ │ │ │ │ ├── GenericResponse.java │ │ │ │ │ ├── InterestGroup.java │ │ │ │ │ ├── Node.java │ │ │ │ │ ├── ProcessId.java │ │ │ │ │ ├── PublishSource.java │ │ │ │ │ ├── PublishType.java │ │ │ │ │ ├── PublisherDigestUtil.java │ │ │ │ │ ├── PublisherUtils.java │ │ │ │ │ ├── RegisterVersion.java │ │ │ │ │ ├── SegmentPushInfo.java │ │ │ │ │ ├── ServerDataBox.java │ │ │ │ │ ├── ServerDataBoxInputStream.java │ │ │ │ │ ├── SubscriberUtils.java │ │ │ │ │ ├── TraceTimes.java │ │ │ │ │ ├── Triple.java │ │ │ │ │ ├── Tuple.java │ │ │ │ │ ├── appmeta │ │ │ │ │ └── InterfaceMapping.java │ │ │ │ │ ├── client │ │ │ │ │ └── pb │ │ │ │ │ │ ├── AppDiscoveryMetaPb.java │ │ │ │ │ │ ├── AppList.java │ │ │ │ │ │ ├── AppListOrBuilder.java │ │ │ │ │ │ ├── BaseRegisterPb.java │ │ │ │ │ │ ├── BaseRegisterPbOrBuilder.java │ │ │ │ │ │ ├── BaseRegisterPbOuterClass.java │ │ │ │ │ │ ├── DataBoxPb.java │ │ │ │ │ │ ├── DataBoxPbOrBuilder.java │ │ │ │ │ │ ├── DataBoxPbOuterClass.java │ │ │ │ │ │ ├── DataBoxesPb.java │ │ │ │ │ │ ├── DataBoxesPbOrBuilder.java │ │ │ │ │ │ ├── DataBoxesPbOuterClass.java │ │ │ │ │ │ ├── EventTypePb.java │ │ │ │ │ │ ├── EventTypePbOuterClass.java │ │ │ │ │ │ ├── GetRevisionsRequest.java │ │ │ │ │ │ ├── GetRevisionsRequestOrBuilder.java │ │ │ │ │ │ ├── GetRevisionsResponse.java │ │ │ │ │ │ ├── GetRevisionsResponseOrBuilder.java │ │ │ │ │ │ ├── MetaHeartbeatRequest.java │ │ │ │ │ │ ├── MetaHeartbeatRequestOrBuilder.java │ │ │ │ │ │ ├── MetaHeartbeatResponse.java │ │ │ │ │ │ ├── MetaHeartbeatResponseOrBuilder.java │ │ │ │ │ │ ├── MetaRegister.java │ │ │ │ │ │ ├── MetaRegisterOrBuilder.java │ │ │ │ │ │ ├── MetaService.java │ │ │ │ │ │ ├── MetaServiceOrBuilder.java │ │ │ │ │ │ ├── MultiReceivedDataPb.java │ │ │ │ │ │ ├── MultiReceivedDataPbOrBuilder.java │ │ │ │ │ │ ├── MultiReceivedDataPbOuterClass.java │ │ │ │ │ │ ├── MultiSegmentDataPb.java │ │ │ │ │ │ ├── MultiSegmentDataPbOrBuilder.java │ │ │ │ │ │ ├── MultiSegmentDataPbOuterClass.java │ │ │ │ │ │ ├── PublisherRegisterPb.java │ │ │ │ │ │ ├── PublisherRegisterPbOrBuilder.java │ │ │ │ │ │ ├── PublisherRegisterPbOuterClass.java │ │ │ │ │ │ ├── ReceivedConfigDataPb.java │ │ │ │ │ │ ├── ReceivedConfigDataPbOrBuilder.java │ │ │ │ │ │ ├── ReceivedConfigDataPbOuterClass.java │ │ │ │ │ │ ├── ReceivedDataBodyPb.java │ │ │ │ │ │ ├── ReceivedDataBodyPbOrBuilder.java │ │ │ │ │ │ ├── ReceivedDataBodyPbOuterClass.java │ │ │ │ │ │ ├── ReceivedDataPb.java │ │ │ │ │ │ ├── ReceivedDataPbOrBuilder.java │ │ │ │ │ │ ├── ReceivedDataPbOuterClass.java │ │ │ │ │ │ ├── RegisterResponsePb.java │ │ │ │ │ │ ├── RegisterResponsePbOrBuilder.java │ │ │ │ │ │ ├── RegisterResponsePbOuterClass.java │ │ │ │ │ │ ├── ResultPb.java │ │ │ │ │ │ ├── ResultPbOrBuilder.java │ │ │ │ │ │ ├── ResultPbOuterClass.java │ │ │ │ │ │ ├── ScopeEnumPb.java │ │ │ │ │ │ ├── ScopeEnumPbOuterClass.java │ │ │ │ │ │ ├── ServiceAppMappingRequest.java │ │ │ │ │ │ ├── ServiceAppMappingRequestOrBuilder.java │ │ │ │ │ │ ├── ServiceAppMappingResponse.java │ │ │ │ │ │ ├── ServiceAppMappingResponseOrBuilder.java │ │ │ │ │ │ ├── StringList.java │ │ │ │ │ │ ├── StringListOrBuilder.java │ │ │ │ │ │ ├── SubscriberRegisterPb.java │ │ │ │ │ │ ├── SubscriberRegisterPbOrBuilder.java │ │ │ │ │ │ ├── SubscriberRegisterPbOuterClass.java │ │ │ │ │ │ ├── SyncConfigRequestPb.java │ │ │ │ │ │ ├── SyncConfigRequestPbOrBuilder.java │ │ │ │ │ │ ├── SyncConfigRequestPbOuterClass.java │ │ │ │ │ │ ├── SyncConfigResponsePb.java │ │ │ │ │ │ ├── SyncConfigResponsePbOrBuilder.java │ │ │ │ │ │ └── SyncConfigResponsePbOuterClass.java │ │ │ │ │ ├── console │ │ │ │ │ ├── CircuitBreakerData.java │ │ │ │ │ ├── MultiSegmentSyncSwitch.java │ │ │ │ │ ├── PersistenceData.java │ │ │ │ │ └── PersistenceDataBuilder.java │ │ │ │ │ ├── constants │ │ │ │ │ ├── MultiValueConstants.java │ │ │ │ │ └── ValueConstants.java │ │ │ │ │ ├── dataserver │ │ │ │ │ ├── AbstractSlotRequest.java │ │ │ │ │ ├── BatchRequest.java │ │ │ │ │ ├── ClientOffPublisher.java │ │ │ │ │ ├── Datum.java │ │ │ │ │ ├── DatumDigest.java │ │ │ │ │ ├── DatumSummary.java │ │ │ │ │ ├── DatumVersion.java │ │ │ │ │ ├── GetDataRequest.java │ │ │ │ │ ├── GetDataVersionRequest.java │ │ │ │ │ └── GetMultiDataRequest.java │ │ │ │ │ ├── elector │ │ │ │ │ ├── DistributeLockInfo.java │ │ │ │ │ └── LeaderInfo.java │ │ │ │ │ ├── metaserver │ │ │ │ │ ├── ClientManagerAddress.java │ │ │ │ │ ├── ClientManagerResult.java │ │ │ │ │ ├── CompressDatumSwitch.java │ │ │ │ │ ├── CompressPushSwitch.java │ │ │ │ │ ├── DataCenterNodes.java │ │ │ │ │ ├── DataOperation.java │ │ │ │ │ ├── FetchProvideDataRequest.java │ │ │ │ │ ├── FetchSystemPropertyRequest.java │ │ │ │ │ ├── FetchSystemPropertyResult.java │ │ │ │ │ ├── GetSlotTableRequest.java │ │ │ │ │ ├── GetSlotTableResult.java │ │ │ │ │ ├── Lease.java │ │ │ │ │ ├── MultiClusterSyncInfo.java │ │ │ │ │ ├── NodeChangeResult.java │ │ │ │ │ ├── NodeServerOperateInfo.java │ │ │ │ │ ├── OperationInfo.java │ │ │ │ │ ├── ProvideData.java │ │ │ │ │ ├── ProvideDataChangeEvent.java │ │ │ │ │ ├── RemoteDatumClearEvent.java │ │ │ │ │ ├── ShutdownSwitch.java │ │ │ │ │ ├── SlotTableChangeEvent.java │ │ │ │ │ ├── blacklist │ │ │ │ │ │ └── RegistryForbiddenServerRequest.java │ │ │ │ │ ├── cleaner │ │ │ │ │ │ ├── AppRevisionSlice.java │ │ │ │ │ │ ├── AppRevisionSliceRequest.java │ │ │ │ │ │ └── BaseSliceRequest.java │ │ │ │ │ ├── cluster │ │ │ │ │ │ ├── Cluster.java │ │ │ │ │ │ └── VersionedList.java │ │ │ │ │ ├── inter │ │ │ │ │ │ └── heartbeat │ │ │ │ │ │ │ ├── BaseHeartBeatResponse.java │ │ │ │ │ │ │ └── HeartbeatRequest.java │ │ │ │ │ ├── nodes │ │ │ │ │ │ ├── AbstractNode.java │ │ │ │ │ │ ├── DataNode.java │ │ │ │ │ │ ├── MetaNode.java │ │ │ │ │ │ └── SessionNode.java │ │ │ │ │ └── rpc │ │ │ │ │ │ └── NodeClusterViewRequest.java │ │ │ │ │ ├── multi │ │ │ │ │ └── cluster │ │ │ │ │ │ ├── DataCenterMetadata.java │ │ │ │ │ │ └── RemoteSlotTableStatus.java │ │ │ │ │ ├── sessionserver │ │ │ │ │ ├── CancelAddressRequest.java │ │ │ │ │ ├── CheckClientManagerRequest.java │ │ │ │ │ ├── CheckClientManagerResponse.java │ │ │ │ │ ├── ClientManagerQueryRequest.java │ │ │ │ │ ├── ClientManagerResp.java │ │ │ │ │ ├── ClientOffRequest.java │ │ │ │ │ ├── ClientOnRequest.java │ │ │ │ │ ├── DataChangeRequest.java │ │ │ │ │ ├── DataPushRequest.java │ │ │ │ │ ├── FilterSubscriberIPsRequest.java │ │ │ │ │ ├── GrayOpenPushSwitchRequest.java │ │ │ │ │ ├── PubSubDataInfoIdRequest.java │ │ │ │ │ ├── PubSubDataInfoIdResp.java │ │ │ │ │ ├── QueryPublisherRequest.java │ │ │ │ │ ├── QuerySubscriberCountByAppRequest.java │ │ │ │ │ ├── QuerySubscriberRequest.java │ │ │ │ │ ├── SimplePublisher.java │ │ │ │ │ ├── SimpleSubscriber.java │ │ │ │ │ ├── StopPushRequest.java │ │ │ │ │ └── SubscriberCountByApp.java │ │ │ │ │ ├── slot │ │ │ │ │ ├── BaseSlotStatus.java │ │ │ │ │ ├── DataNodeSlot.java │ │ │ │ │ ├── DataSlotDiffDigestRequest.java │ │ │ │ │ ├── DataSlotDiffDigestResult.java │ │ │ │ │ ├── DataSlotDiffPublisherRequest.java │ │ │ │ │ ├── DataSlotDiffPublisherResult.java │ │ │ │ │ ├── DataSlotDiffUtils.java │ │ │ │ │ ├── FollowerSlotStatus.java │ │ │ │ │ ├── GetSlotTableStatusRequest.java │ │ │ │ │ ├── LeaderSlotStatus.java │ │ │ │ │ ├── MultiSlotAccessGenericResponse.java │ │ │ │ │ ├── Slot.java │ │ │ │ │ ├── SlotAccess.java │ │ │ │ │ ├── SlotAccessGenericResponse.java │ │ │ │ │ ├── SlotConfig.java │ │ │ │ │ ├── SlotTable.java │ │ │ │ │ ├── SlotTableStatusResponse.java │ │ │ │ │ ├── filter │ │ │ │ │ │ ├── BaseSyncSlotAcceptorManager.java │ │ │ │ │ │ ├── MultiSyncDataAcceptorManager.java │ │ │ │ │ │ ├── SyncAcceptorRequest.java │ │ │ │ │ │ ├── SyncPublishSourceAcceptor.java │ │ │ │ │ │ ├── SyncPublisherGroupAcceptor.java │ │ │ │ │ │ ├── SyncSlotAcceptAllManager.java │ │ │ │ │ │ ├── SyncSlotAcceptor.java │ │ │ │ │ │ ├── SyncSlotAcceptorManager.java │ │ │ │ │ │ └── SyncSlotDataInfoIdAcceptor.java │ │ │ │ │ └── func │ │ │ │ │ │ ├── Crc32cSlotFunction.java │ │ │ │ │ │ ├── HashFunction.java │ │ │ │ │ │ ├── MD5HashFunction.java │ │ │ │ │ │ ├── MD5SlotFunction.java │ │ │ │ │ │ ├── SlotFunction.java │ │ │ │ │ │ └── SlotFunctionRegistry.java │ │ │ │ │ ├── store │ │ │ │ │ ├── AppRevision.java │ │ │ │ │ ├── BaseInfo.java │ │ │ │ │ ├── CircuitBreakerStatistic.java │ │ │ │ │ ├── DataInfo.java │ │ │ │ │ ├── MultiSubDatum.java │ │ │ │ │ ├── ProcessIdCache.java │ │ │ │ │ ├── Publisher.java │ │ │ │ │ ├── PushData.java │ │ │ │ │ ├── StoreData.java │ │ │ │ │ ├── SubDatum.java │ │ │ │ │ ├── SubPublisher.java │ │ │ │ │ ├── SubPublisherList.java │ │ │ │ │ ├── Subscriber.java │ │ │ │ │ ├── URL.java │ │ │ │ │ ├── UnPublisher.java │ │ │ │ │ ├── Watcher.java │ │ │ │ │ ├── WordCache.java │ │ │ │ │ └── ZipSubPublisherList.java │ │ │ │ │ └── wrapper │ │ │ │ │ ├── Wrapper.java │ │ │ │ │ ├── WrapperInterceptor.java │ │ │ │ │ └── WrapperInvocation.java │ │ │ └── resources │ │ │ │ └── proto │ │ │ │ ├── AppDiscoveryMetaPb.proto │ │ │ │ ├── BaseRegisterPb.proto │ │ │ │ ├── DataBoxPb.proto │ │ │ │ ├── DataBoxesPb.proto │ │ │ │ ├── EventTypePb.proto │ │ │ │ ├── MultiReceivedDataPb.proto │ │ │ │ ├── MultiSegmentDataPb.proto │ │ │ │ ├── PublisherRegisterPb.proto │ │ │ │ ├── ReceivedConfigDataPb.proto │ │ │ │ ├── ReceivedDataBodyPb.proto │ │ │ │ ├── ReceivedDataPb.proto │ │ │ │ ├── RegisterResponsePb.proto │ │ │ │ ├── ResultPb.proto │ │ │ │ ├── ScopeEnumPb.proto │ │ │ │ ├── SubscriberRegisterPb.proto │ │ │ │ ├── SyncConfigRequestPb.proto │ │ │ │ └── SyncConfigResponsePb.proto │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── alipay │ │ │ └── sofa │ │ │ └── registry │ │ │ └── common │ │ │ └── model │ │ │ ├── InterestGroupTest.java │ │ │ ├── PublisherDigestUtilTest.java │ │ │ ├── SubscriberUtilsTest.java │ │ │ ├── TraceTimeTest.java │ │ │ ├── console │ │ │ └── MultiSegmentSyncSwitchTest.java │ │ │ ├── dataserver │ │ │ ├── DatumDigestTest.java │ │ │ └── GetMultiDataRequestTest.java │ │ │ ├── metaserver │ │ │ ├── CompressPushSwitchTest.java │ │ │ ├── NodeServerOperateInfoBenchmark.java │ │ │ ├── NodeServerOperateInfoTest.java │ │ │ ├── blacklist │ │ │ │ └── RegistryForbiddenServerRequestTest.java │ │ │ ├── nodes │ │ │ │ └── NodeTest.java │ │ │ └── rpc │ │ │ │ ├── DataCenterNodesTest.java │ │ │ │ └── NodeClusterViewRequestTest.java │ │ │ ├── multi │ │ │ ├── DataCenterMetadataTest.java │ │ │ └── RemoteSlotTableStatusTest.java │ │ │ ├── slot │ │ │ ├── Crc32cSlotFunctionTest.java │ │ │ ├── DataSlotDiffSyncResultTest.java │ │ │ └── filter │ │ │ │ └── MultiSyncDataAcceptorManagerTest.java │ │ │ └── store │ │ │ ├── SubDatumTest.java │ │ │ ├── SubPublisherListTest.java │ │ │ └── SubTest.java │ ├── pom.xml │ └── util │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ └── java │ │ │ ├── com │ │ │ └── alipay │ │ │ │ └── sofa │ │ │ │ └── registry │ │ │ │ ├── cache │ │ │ │ ├── CacheCleaner.java │ │ │ │ ├── ConsecutiveSuccess.java │ │ │ │ └── Sizer.java │ │ │ │ ├── collections │ │ │ │ ├── AbstractImmutableMap.java │ │ │ │ ├── ImmutableMap4.java │ │ │ │ └── Maps.java │ │ │ │ ├── compress │ │ │ │ ├── CompressCachedExecutor.java │ │ │ │ ├── CompressConstants.java │ │ │ │ ├── CompressDatumKey.java │ │ │ │ ├── CompressKey.java │ │ │ │ ├── CompressPushKey.java │ │ │ │ ├── CompressUtils.java │ │ │ │ ├── CompressedItem.java │ │ │ │ └── Compressor.java │ │ │ │ ├── concurrent │ │ │ │ ├── CachedExecutor.java │ │ │ │ ├── SingleFlight.java │ │ │ │ ├── ThreadLocalByteArrayOutputStream.java │ │ │ │ ├── ThreadLocalStringBuilder.java │ │ │ │ └── UnThrowableCallable.java │ │ │ │ ├── converter │ │ │ │ └── ScopeEnumConverter.java │ │ │ │ ├── datacenter │ │ │ │ └── DataCenterAware.java │ │ │ │ ├── exception │ │ │ │ ├── DisposeException.java │ │ │ │ ├── InitializeException.java │ │ │ │ ├── MetaLeaderNotWarmupException.java │ │ │ │ ├── MetaLeaderQueryException.java │ │ │ │ ├── SofaRegistryMetaLeaderException.java │ │ │ │ ├── SofaRegistryRuntimeException.java │ │ │ │ ├── SofaRegistrySlotTableException.java │ │ │ │ ├── StartException.java │ │ │ │ ├── StopException.java │ │ │ │ └── UnSupportOperationException.java │ │ │ │ ├── lifecycle │ │ │ │ ├── Disposable.java │ │ │ │ ├── Initializable.java │ │ │ │ ├── Lifecycle.java │ │ │ │ ├── LifecycleController.java │ │ │ │ ├── LifecycleState.java │ │ │ │ ├── LifecycleStateAware.java │ │ │ │ ├── LiteLifecycle.java │ │ │ │ ├── Startable.java │ │ │ │ ├── Stoppable.java │ │ │ │ ├── Suspendable.java │ │ │ │ └── impl │ │ │ │ │ ├── AbstractLifecycle.java │ │ │ │ │ ├── DefaultLifecycleController.java │ │ │ │ │ ├── DefaultLifecycleState.java │ │ │ │ │ └── LifecycleHelper.java │ │ │ │ ├── log │ │ │ │ ├── Logger.java │ │ │ │ ├── LoggerFactory.java │ │ │ │ ├── MDC.java │ │ │ │ ├── SLF4JLogger.java │ │ │ │ └── SafeLogger.java │ │ │ │ ├── metrics │ │ │ │ ├── CounterFunc.java │ │ │ │ ├── GaugeFunc.java │ │ │ │ ├── ReporterUtils.java │ │ │ │ └── TaskMetrics.java │ │ │ │ ├── net │ │ │ │ └── NetUtil.java │ │ │ │ ├── observer │ │ │ │ ├── Observable.java │ │ │ │ ├── UnblockingObserver.java │ │ │ │ └── impl │ │ │ │ │ └── AbstractLifecycleObservable.java │ │ │ │ ├── task │ │ │ │ ├── BlockingQueues.java │ │ │ │ ├── FastRejectedExecutionException.java │ │ │ │ ├── KeyedTask.java │ │ │ │ ├── KeyedThreadPoolExecutor.java │ │ │ │ ├── MetricsableThreadPoolExecutor.java │ │ │ │ ├── RejectedDiscardHandler.java │ │ │ │ ├── RejectedLogErrorHandler.java │ │ │ │ └── TaskErrorSilenceException.java │ │ │ │ ├── trace │ │ │ │ └── TraceID.java │ │ │ │ └── util │ │ │ │ ├── AtomicMap.java │ │ │ │ ├── AtomicSet.java │ │ │ │ ├── BackOffTimes.java │ │ │ │ ├── BatchCallableRunnable.java │ │ │ │ ├── Bool.java │ │ │ │ ├── CollectionUtils.java │ │ │ │ ├── ConcurrentUtils.java │ │ │ │ ├── DatumVersionUtil.java │ │ │ │ ├── DefaultExecutorFactory.java │ │ │ │ ├── FileUtils.java │ │ │ │ ├── JsonUtils.java │ │ │ │ ├── LoopRunnable.java │ │ │ │ ├── MathUtils.java │ │ │ │ ├── MessageDigests.java │ │ │ │ ├── NamedThreadFactory.java │ │ │ │ ├── ObjectFactory.java │ │ │ │ ├── OsUtils.java │ │ │ │ ├── ParaCheckUtil.java │ │ │ │ ├── PropertySplitter.java │ │ │ │ ├── RevisionUtils.java │ │ │ │ ├── StringFormatter.java │ │ │ │ ├── StringUtils.java │ │ │ │ ├── SystemUtils.java │ │ │ │ ├── TimestampUtil.java │ │ │ │ └── WakeUpLoopRunnable.java │ │ │ └── org │ │ │ └── apache │ │ │ └── logging │ │ │ └── log4j │ │ │ └── core │ │ │ └── async │ │ │ ├── Hack.java │ │ │ └── HackAsyncLoggerDisruptor.java │ │ └── test │ │ ├── java │ │ ├── com │ │ │ └── alipay │ │ │ │ └── sofa │ │ │ │ └── registry │ │ │ │ ├── AbstractTestBase.java │ │ │ │ ├── TestScheduler.java │ │ │ │ ├── TestUtils.java │ │ │ │ ├── cache │ │ │ │ └── ConsecutiveSuccessTest.java │ │ │ │ ├── collections │ │ │ │ ├── ImmutableMap4Test.java │ │ │ │ └── MapsTest.java │ │ │ │ ├── compress │ │ │ │ ├── CompressKeyTest.java │ │ │ │ └── CompressorTest.java │ │ │ │ ├── concurrent │ │ │ │ ├── CachedExecutorTest.java │ │ │ │ └── ThreadLocalStringBuilderTest.java │ │ │ │ ├── converter │ │ │ │ └── ScopeEnumConverterTest.java │ │ │ │ ├── hacktest │ │ │ │ └── HackWrapperTest.java │ │ │ │ ├── lifecycle │ │ │ │ ├── LifecycleStateTest.java │ │ │ │ └── impl │ │ │ │ │ └── LifecycleTest.java │ │ │ │ ├── log │ │ │ │ └── SafeLoggerTest.java │ │ │ │ ├── metrics │ │ │ │ ├── CounterFuncTest.java │ │ │ │ └── GaugeFuncTest.java │ │ │ │ ├── net │ │ │ │ └── NetUtilTest.java │ │ │ │ ├── observer │ │ │ │ └── impl │ │ │ │ │ └── AbstractLifecycleObservableTest.java │ │ │ │ ├── task │ │ │ │ ├── BlockingQueuesTest.java │ │ │ │ ├── KeyedTaskTest.java │ │ │ │ └── MetricsableThreadPoolExecutorTest.java │ │ │ │ ├── trace │ │ │ │ └── TraceIDTest.java │ │ │ │ └── util │ │ │ │ ├── AtomicMapTest.java │ │ │ │ ├── AtomicSetTest.java │ │ │ │ ├── BatchCallableRunnableTest.java │ │ │ │ ├── BoolTest.java │ │ │ │ ├── CollectionUtilsTest.java │ │ │ │ ├── ConcurrentUtilsTest.java │ │ │ │ ├── DatumVersionUtilTest.java │ │ │ │ ├── DefaultExecutorFactoryTest.java │ │ │ │ ├── FileUtilsTest.java │ │ │ │ ├── JsonUtilsTest.java │ │ │ │ ├── MathUtilsTest.java │ │ │ │ ├── MessageDigestsTest.java │ │ │ │ ├── OsUtilsTest.java │ │ │ │ ├── ParaCheckUtilTest.java │ │ │ │ ├── PropertySplitterTest.java │ │ │ │ ├── RevisionUtilsTest.java │ │ │ │ ├── SingleFlightTest.java │ │ │ │ ├── TimestampUtilTest.java │ │ │ │ └── WakeUpLoopRunnableTest.java │ │ └── org │ │ │ └── apache │ │ │ └── logging │ │ │ └── log4j │ │ │ └── core │ │ │ └── async │ │ │ └── HackTest.java │ │ └── resources │ │ ├── log4j2.xml │ │ └── push_example.json ├── distribution │ ├── all │ │ ├── bin │ │ │ ├── base │ │ │ │ ├── shutdown_base.sh │ │ │ │ └── start_base.sh │ │ │ ├── data │ │ │ │ ├── shutdown.sh │ │ │ │ └── start.sh │ │ │ ├── integration │ │ │ │ ├── shutdown.sh │ │ │ │ ├── start.sh │ │ │ │ └── start_dev.sh │ │ │ ├── meta │ │ │ │ ├── shutdown.sh │ │ │ │ └── start.sh │ │ │ ├── registry-run.sh │ │ │ └── session │ │ │ │ ├── shutdown.sh │ │ │ │ └── start.sh │ │ ├── conf │ │ │ ├── application-dev.properties │ │ │ ├── application.properties │ │ │ └── supervisord │ │ │ │ └── registry.supervisord.conf │ │ ├── distribution-all.xml │ │ └── pom.xml │ └── pom.xml ├── pom.xml ├── remoting │ ├── api │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── alipay │ │ │ │ └── sofa │ │ │ │ └── registry │ │ │ │ └── remoting │ │ │ │ ├── CallbackHandler.java │ │ │ │ ├── Channel.java │ │ │ │ ├── ChannelConnectException.java │ │ │ │ ├── ChannelHandler.java │ │ │ │ ├── ChannelOverflowException.java │ │ │ │ ├── Client.java │ │ │ │ ├── Endpoint.java │ │ │ │ ├── RemotingException.java │ │ │ │ ├── Server.java │ │ │ │ └── exchange │ │ │ │ ├── Exchange.java │ │ │ │ ├── ExchangeCallback.java │ │ │ │ ├── NodeExchanger.java │ │ │ │ ├── RequestChannelClosedException.java │ │ │ │ ├── RequestException.java │ │ │ │ └── message │ │ │ │ ├── Request.java │ │ │ │ ├── Response.java │ │ │ │ └── SimpleRequest.java │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── alipay │ │ │ └── sofa │ │ │ └── registry │ │ │ └── remoting │ │ │ ├── RequestExceptionTest.java │ │ │ └── exchange │ │ │ └── message │ │ │ └── SimpleRequestTest.java │ ├── bolt │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── alipay │ │ │ │ └── sofa │ │ │ │ └── registry │ │ │ │ └── remoting │ │ │ │ └── bolt │ │ │ │ ├── AsyncUserProcessorAdapter.java │ │ │ │ ├── BoltChannel.java │ │ │ │ ├── BoltClient.java │ │ │ │ ├── BoltServer.java │ │ │ │ ├── BoltUtil.java │ │ │ │ ├── ConnectionEventAdapter.java │ │ │ │ ├── InvokeCallbackHandler.java │ │ │ │ ├── SyncUserProcessorAdapter.java │ │ │ │ ├── exchange │ │ │ │ └── BoltExchange.java │ │ │ │ └── serializer │ │ │ │ ├── CustomClassSerializerManager.java │ │ │ │ ├── ProtobufCustomSerializer.java │ │ │ │ └── ProtobufSerializer.java │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── alipay │ │ │ └── sofa │ │ │ └── registry │ │ │ └── remoting │ │ │ └── bolt │ │ │ ├── AsyncUserProcessorAdapterTest.java │ │ │ ├── BoltServerTest.java │ │ │ ├── BoltUtilTest.java │ │ │ ├── ConnectionEventAdapterTest.java │ │ │ ├── InvokeCallbackHandlerTest.java │ │ │ ├── MockChannel.java │ │ │ ├── MockChannelHandlerContext.java │ │ │ ├── SyncUserProcessorAdapterTest.java │ │ │ ├── TestUtils.java │ │ │ ├── exchange │ │ │ └── BoltExchangeTest.java │ │ │ └── serializer │ │ │ ├── CustomClassSerializerManagerTest.java │ │ │ ├── ProtobufCustomSerializerTest.java │ │ │ └── ProtobufSerializerTest.java │ ├── http │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── alipay │ │ │ │ └── sofa │ │ │ │ └── registry │ │ │ │ └── remoting │ │ │ │ └── jersey │ │ │ │ ├── JerseyChannel.java │ │ │ │ ├── JerseyClient.java │ │ │ │ ├── JerseyJettyServer.java │ │ │ │ ├── exchange │ │ │ │ └── JerseyExchange.java │ │ │ │ └── jetty │ │ │ │ └── server │ │ │ │ ├── HttpChannelOverHttpCustom.java │ │ │ │ ├── HttpConnectionCustom.java │ │ │ │ └── HttpConnectionCustomFactory.java │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── alipay │ │ │ └── sofa │ │ │ └── registry │ │ │ └── remoting │ │ │ └── jersey │ │ │ ├── JerseyExchangeTest.java │ │ │ └── TestHttpResource.java │ └── pom.xml ├── server │ ├── data │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── alipay │ │ │ │ │ └── sofa │ │ │ │ │ └── registry │ │ │ │ │ └── server │ │ │ │ │ └── data │ │ │ │ │ ├── DataApplication.java │ │ │ │ │ ├── bootstrap │ │ │ │ │ ├── DataServerBeanConfiguration.java │ │ │ │ │ ├── DataServerBootstrap.java │ │ │ │ │ ├── DataServerConfig.java │ │ │ │ │ ├── DataServerInitializer.java │ │ │ │ │ ├── EnableDataServer.java │ │ │ │ │ ├── MultiClusterDataConfiguration.java │ │ │ │ │ ├── MultiClusterDataServerConfig.java │ │ │ │ │ └── MultiClusterDataServerConfigBean.java │ │ │ │ │ ├── cache │ │ │ │ │ ├── BaseDatumStorage.java │ │ │ │ │ ├── CleanContinues.java │ │ │ │ │ ├── DatumStorage.java │ │ │ │ │ ├── DatumStorageDelegate.java │ │ │ │ │ ├── LocalDatumStorage.java │ │ │ │ │ ├── PublisherEnvelope.java │ │ │ │ │ ├── PublisherGroup.java │ │ │ │ │ └── PublisherGroups.java │ │ │ │ │ ├── change │ │ │ │ │ ├── ChangeMetrics.java │ │ │ │ │ ├── DataChangeEvent.java │ │ │ │ │ ├── DataChangeEventCenter.java │ │ │ │ │ ├── DataChangeMerger.java │ │ │ │ │ └── DataChangeType.java │ │ │ │ │ ├── lease │ │ │ │ │ └── SessionLeaseManager.java │ │ │ │ │ ├── multi │ │ │ │ │ └── cluster │ │ │ │ │ │ ├── client │ │ │ │ │ │ └── handler │ │ │ │ │ │ │ └── RemoteDataChangeNotifyHandler.java │ │ │ │ │ │ ├── dataserver │ │ │ │ │ │ └── handler │ │ │ │ │ │ │ ├── MultiClusterSlotDiffDigestRequestHandler.java │ │ │ │ │ │ │ └── MultiClusterSlotDiffPublisherRequestHandler.java │ │ │ │ │ │ ├── exchanger │ │ │ │ │ │ └── RemoteDataNodeExchanger.java │ │ │ │ │ │ ├── executor │ │ │ │ │ │ └── MultiClusterExecutorManager.java │ │ │ │ │ │ ├── loggers │ │ │ │ │ │ └── Loggers.java │ │ │ │ │ │ ├── slot │ │ │ │ │ │ ├── MultiClusterSlotManager.java │ │ │ │ │ │ ├── MultiClusterSlotManagerImpl.java │ │ │ │ │ │ └── MultiClusterSlotMetrics.java │ │ │ │ │ │ ├── storage │ │ │ │ │ │ ├── MultiClusterDatumService.java │ │ │ │ │ │ └── MultiClusterDatumStorage.java │ │ │ │ │ │ └── sync │ │ │ │ │ │ └── info │ │ │ │ │ │ └── FetchMultiSyncService.java │ │ │ │ │ ├── providedata │ │ │ │ │ ├── CompressDatumService.java │ │ │ │ │ └── FetchStopPushService.java │ │ │ │ │ ├── pubiterator │ │ │ │ │ └── DatumBiConsumer.java │ │ │ │ │ ├── remoting │ │ │ │ │ ├── DataMetaServerManager.java │ │ │ │ │ ├── DataNodeExchanger.java │ │ │ │ │ ├── SessionNodeExchanger.java │ │ │ │ │ ├── dataserver │ │ │ │ │ │ └── handler │ │ │ │ │ │ │ ├── BaseSlotDiffDigestRequestHandler.java │ │ │ │ │ │ │ ├── BaseSlotDiffPublisherRequestHandler.java │ │ │ │ │ │ │ ├── SlotFollowerDiffDigestRequestHandler.java │ │ │ │ │ │ │ └── SlotFollowerDiffPublisherRequestHandler.java │ │ │ │ │ ├── metaserver │ │ │ │ │ │ ├── MetaServerServiceImpl.java │ │ │ │ │ │ ├── handler │ │ │ │ │ │ │ ├── NotifyProvideDataChangeHandler.java │ │ │ │ │ │ │ └── RemoteDatumClearEventHandler.java │ │ │ │ │ │ └── provideData │ │ │ │ │ │ │ ├── ProvideDataProcessorManager.java │ │ │ │ │ │ │ └── processor │ │ │ │ │ │ │ └── SessionLeaseProvideDataProcessor.java │ │ │ │ │ └── sessionserver │ │ │ │ │ │ └── handler │ │ │ │ │ │ ├── AbstractDataHandler.java │ │ │ │ │ │ ├── BaseGetDataHandler.java │ │ │ │ │ │ ├── BatchPutDataHandler.java │ │ │ │ │ │ ├── DataLog.java │ │ │ │ │ │ ├── GetDataHandler.java │ │ │ │ │ │ ├── GetDataVersionsHandler.java │ │ │ │ │ │ ├── GetMultiDataHandler.java │ │ │ │ │ │ └── HandlerMetrics.java │ │ │ │ │ ├── resource │ │ │ │ │ ├── DataDigestResource.java │ │ │ │ │ ├── DatumApiResource.java │ │ │ │ │ ├── DatumParam.java │ │ │ │ │ ├── HealthResource.java │ │ │ │ │ └── SlotTableStatusResource.java │ │ │ │ │ ├── slot │ │ │ │ │ ├── SlotAccessor.java │ │ │ │ │ ├── SlotAccessorDelegate.java │ │ │ │ │ ├── SlotChangeListener.java │ │ │ │ │ ├── SlotChangeListenerManager.java │ │ │ │ │ ├── SlotDiffSyncer.java │ │ │ │ │ ├── SlotManager.java │ │ │ │ │ ├── SlotManagerImpl.java │ │ │ │ │ ├── SlotMetrics.java │ │ │ │ │ ├── SyncContinues.java │ │ │ │ │ └── SyncLeaderTask.java │ │ │ │ │ └── timer │ │ │ │ │ ├── CacheCountTask.java │ │ │ │ │ ├── CacheDigestTask.java │ │ │ │ │ └── Metrics.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── log4j2.xml │ │ │ │ └── security │ │ │ │ └── blacklist.txt │ │ │ └── test │ │ │ ├── java │ │ │ └── com │ │ │ │ └── alipay │ │ │ │ └── sofa │ │ │ │ └── registry │ │ │ │ └── server │ │ │ │ └── data │ │ │ │ ├── MigrateTest.java │ │ │ │ ├── TestBaseUtils.java │ │ │ │ ├── bootstrap │ │ │ │ └── DataServerBootstrapTest.java │ │ │ │ ├── cache │ │ │ │ ├── DatumStorageDelegateTest.java │ │ │ │ ├── LocalDatumStorageTest.java │ │ │ │ ├── PublisherEnvelopeTest.java │ │ │ │ ├── PublisherGroupTest.java │ │ │ │ └── PublisherGroupsTest.java │ │ │ │ ├── change │ │ │ │ └── DataChangeEventCenterTest.java │ │ │ │ ├── compress │ │ │ │ └── CompressDatumServiceTest.java │ │ │ │ ├── lease │ │ │ │ └── SessionLeaseManagerTest.java │ │ │ │ ├── multi │ │ │ │ └── cluster │ │ │ │ │ ├── client │ │ │ │ │ └── handler │ │ │ │ │ │ └── RemoteDataChangeNotifyHandlerTest.java │ │ │ │ │ ├── dataserver │ │ │ │ │ └── handler │ │ │ │ │ │ └── MultiClusterSlotDiffDigestRequestHandlerTest.java │ │ │ │ │ ├── exchanger │ │ │ │ │ └── RemoteDataNodeExchangerTest.java │ │ │ │ │ ├── slot │ │ │ │ │ └── MultiClusterSlotManagerImplTest.java │ │ │ │ │ ├── storage │ │ │ │ │ ├── MultiClusterDatumServiceTest.java │ │ │ │ │ └── MultiClusterDatumStorageTest.java │ │ │ │ │ └── sync │ │ │ │ │ └── info │ │ │ │ │ └── FetchMultiSyncServiceTest.java │ │ │ │ ├── remoting │ │ │ │ ├── DataMetaServerManagerTest.java │ │ │ │ ├── DataNodeExchangerTest.java │ │ │ │ ├── SessionNodeExchangerTest.java │ │ │ │ ├── dataserver │ │ │ │ │ └── handler │ │ │ │ │ │ ├── SlotFollowerDiffDigestRequestHandlerTest.java │ │ │ │ │ │ └── SlotFollowerDiffPublisherRequestHandlerTest.java │ │ │ │ ├── metaserver │ │ │ │ │ ├── MetaServerServiceImplTest.java │ │ │ │ │ ├── handler │ │ │ │ │ │ └── NotifyProvideDataChangeHandlerTest.java │ │ │ │ │ └── provideData │ │ │ │ │ │ └── processor │ │ │ │ │ │ └── SessionLeaseProvideDataProcessorTest.java │ │ │ │ └── sessionserver │ │ │ │ │ └── handler │ │ │ │ │ ├── BatchPutDataHandlerTest.java │ │ │ │ │ ├── GetDataHandlerTest.java │ │ │ │ │ └── GetDataVersionsHandlerTest.java │ │ │ │ ├── resource │ │ │ │ ├── DataDigestResourceTest.java │ │ │ │ ├── DatumApiResourceTest.java │ │ │ │ ├── HealthResourceTest.java │ │ │ │ └── SlotTableStatusResourceTest.java │ │ │ │ ├── slot │ │ │ │ ├── SlotDiffSyncerTest.java │ │ │ │ └── SlotManagerImplTest.java │ │ │ │ └── timer │ │ │ │ ├── CacheCountTaskTest.java │ │ │ │ └── CacheDigestTaskTest.java │ │ │ └── resources │ │ │ └── log4j2.xml │ ├── integration │ │ ├── pom.xml │ │ └── src │ │ │ └── main │ │ │ ├── java │ │ │ └── com │ │ │ │ └── alipay │ │ │ │ └── sofa │ │ │ │ └── registry │ │ │ │ └── server │ │ │ │ └── integration │ │ │ │ └── RegistryApplication.java │ │ │ └── resources │ │ │ ├── application-dev.properties │ │ │ ├── application.properties │ │ │ ├── banner.txt │ │ │ ├── log4j2.xml │ │ │ ├── security │ │ │ └── blacklist.txt │ │ │ └── sql │ │ │ └── h2 │ │ │ └── create_table.sql │ ├── meta │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── alipay │ │ │ │ │ └── sofa │ │ │ │ │ └── registry │ │ │ │ │ └── server │ │ │ │ │ └── meta │ │ │ │ │ ├── MetaApplication.java │ │ │ │ │ ├── MetaLeaderService.java │ │ │ │ │ ├── MetaServer.java │ │ │ │ │ ├── bootstrap │ │ │ │ │ ├── EnableMetaServer.java │ │ │ │ │ ├── ExecutorManager.java │ │ │ │ │ ├── MetaServerBootstrap.java │ │ │ │ │ ├── MetaServerConfiguration.java │ │ │ │ │ ├── MetaServerInitializerConfiguration.java │ │ │ │ │ ├── MultiClusterMetaServerConfiguration.java │ │ │ │ │ └── config │ │ │ │ │ │ ├── AbstractNodeConfigBean.java │ │ │ │ │ │ ├── MetaServerConfig.java │ │ │ │ │ │ ├── MetaServerConfigBean.java │ │ │ │ │ │ ├── MultiClusterMetaServerConfig.java │ │ │ │ │ │ ├── MultiClusterMetaServerConfigBean.java │ │ │ │ │ │ ├── NodeConfig.java │ │ │ │ │ │ └── NodeConfigBeanProperty.java │ │ │ │ │ ├── cleaner │ │ │ │ │ ├── AppRevisionCleaner.java │ │ │ │ │ └── InterfaceAppsIndexCleaner.java │ │ │ │ │ ├── cluster │ │ │ │ │ ├── NodeCluster.java │ │ │ │ │ ├── RemoteServer.java │ │ │ │ │ ├── RemoteServers.java │ │ │ │ │ └── node │ │ │ │ │ │ ├── AbstractNodeEvent.java │ │ │ │ │ │ ├── NodeAdded.java │ │ │ │ │ │ ├── NodeEvent.java │ │ │ │ │ │ ├── NodeModified.java │ │ │ │ │ │ └── NodeRemoved.java │ │ │ │ │ ├── lease │ │ │ │ │ ├── Evictable.java │ │ │ │ │ ├── LeaseFilter.java │ │ │ │ │ ├── LeaseManager.java │ │ │ │ │ ├── data │ │ │ │ │ │ ├── DataManagerObserver.java │ │ │ │ │ │ ├── DataServerManager.java │ │ │ │ │ │ └── DefaultDataServerManager.java │ │ │ │ │ ├── filter │ │ │ │ │ │ ├── DefaultForbiddenServerManager.java │ │ │ │ │ │ └── RegistryForbiddenServerManager.java │ │ │ │ │ ├── impl │ │ │ │ │ │ ├── AbstractEvictableFilterableLeaseManager.java │ │ │ │ │ │ ├── AbstractEvictableLeaseManager.java │ │ │ │ │ │ ├── LeaderAwareLeaseManager.java │ │ │ │ │ │ └── SimpleLeaseManager.java │ │ │ │ │ └── session │ │ │ │ │ │ ├── DefaultSessionServerManager.java │ │ │ │ │ │ ├── SessionManagerObserver.java │ │ │ │ │ │ └── SessionServerManager.java │ │ │ │ │ ├── metaserver │ │ │ │ │ ├── CurrentDcMetaServer.java │ │ │ │ │ └── impl │ │ │ │ │ │ ├── AbstractMetaServer.java │ │ │ │ │ │ ├── DefaultCurrentDcMetaServer.java │ │ │ │ │ │ ├── DefaultMetaLeaderElector.java │ │ │ │ │ │ ├── DefaultMetaServerManager.java │ │ │ │ │ │ └── LocalMetaServer.java │ │ │ │ │ ├── monitor │ │ │ │ │ ├── Metrics.java │ │ │ │ │ ├── SlotStats.java │ │ │ │ │ ├── SlotTableMonitor.java │ │ │ │ │ ├── SlotTableStats.java │ │ │ │ │ ├── data │ │ │ │ │ │ ├── DataMessageListener.java │ │ │ │ │ │ ├── DataServerStats.java │ │ │ │ │ │ └── DataSlotMetricsRecorder.java │ │ │ │ │ ├── heartbeat │ │ │ │ │ │ └── HeartbeatListener.java │ │ │ │ │ ├── impl │ │ │ │ │ │ ├── DefaultSlotStats.java │ │ │ │ │ │ ├── DefaultSlotTableMonitor.java │ │ │ │ │ │ └── DefaultSlotTableStats.java │ │ │ │ │ └── session │ │ │ │ │ │ └── SessionMessageListener.java │ │ │ │ │ ├── multi │ │ │ │ │ └── cluster │ │ │ │ │ │ ├── DefaultMultiClusterSlotTableSyncer.java │ │ │ │ │ │ ├── MultiClusterSlotTableSyncer.java │ │ │ │ │ │ └── remote │ │ │ │ │ │ ├── RemoteClusterMetaExchanger.java │ │ │ │ │ │ ├── RemoteClusterSlotSyncHandler.java │ │ │ │ │ │ ├── RemoteClusterSlotSyncRequest.java │ │ │ │ │ │ └── RemoteClusterSlotSyncResponse.java │ │ │ │ │ ├── provide │ │ │ │ │ └── data │ │ │ │ │ │ ├── DefaultClientManagerService.java │ │ │ │ │ │ ├── DefaultProvideDataNotifier.java │ │ │ │ │ │ ├── DefaultProvideDataService.java │ │ │ │ │ │ ├── FetchStopPushService.java │ │ │ │ │ │ ├── NodeOperatingService.java │ │ │ │ │ │ ├── ProvideDataNotifier.java │ │ │ │ │ │ ├── ProvideDataService.java │ │ │ │ │ │ └── package-info.java │ │ │ │ │ ├── remoting │ │ │ │ │ ├── DataNodeExchanger.java │ │ │ │ │ ├── MetaServerExchanger.java │ │ │ │ │ ├── SessionNodeExchanger.java │ │ │ │ │ ├── connection │ │ │ │ │ │ ├── AbstractNodeConnectManager.java │ │ │ │ │ │ ├── DataConnectionManager.java │ │ │ │ │ │ ├── MetaConnectionManager.java │ │ │ │ │ │ ├── NodeConnectManager.java │ │ │ │ │ │ └── SessionConnectionManager.java │ │ │ │ │ ├── data │ │ │ │ │ │ ├── DataServerService.java │ │ │ │ │ │ └── DefaultDataServerService.java │ │ │ │ │ ├── handler │ │ │ │ │ │ ├── BaseMetaServerHandler.java │ │ │ │ │ │ ├── FetchProvideDataRequestHandler.java │ │ │ │ │ │ ├── FetchSystemPropertyRequestHandler.java │ │ │ │ │ │ ├── GetSlotTableStatusRequestHandler.java │ │ │ │ │ │ ├── HeartbeatRequestHandler.java │ │ │ │ │ │ └── RegistryForbiddenServerHandler.java │ │ │ │ │ ├── meta │ │ │ │ │ │ ├── LocalMetaExchanger.java │ │ │ │ │ │ ├── MetaNodeExchange.java │ │ │ │ │ │ └── MetaServerRenewService.java │ │ │ │ │ ├── notifier │ │ │ │ │ │ ├── AbstractNotifier.java │ │ │ │ │ │ └── Notifier.java │ │ │ │ │ └── session │ │ │ │ │ │ ├── DefaultSessionServerService.java │ │ │ │ │ │ └── SessionServerService.java │ │ │ │ │ ├── resource │ │ │ │ │ ├── BlacklistDataResource.java │ │ │ │ │ ├── CircuitBreakerResources.java │ │ │ │ │ ├── ClientManagerResource.java │ │ │ │ │ ├── CompressResource.java │ │ │ │ │ ├── DataInfoIDBlacklistResource.java │ │ │ │ │ ├── HealthResource.java │ │ │ │ │ ├── MetaCenterResource.java │ │ │ │ │ ├── MetaDigestResource.java │ │ │ │ │ ├── MetaLeaderResource.java │ │ │ │ │ ├── MultiClusterSyncResource.java │ │ │ │ │ ├── MultiDatumResource.java │ │ │ │ │ ├── ProvideDataResource.java │ │ │ │ │ ├── RecoverConfigResource.java │ │ │ │ │ ├── RegistryCoreOpsResource.java │ │ │ │ │ ├── RegistryCoreOpsV2Resource.java │ │ │ │ │ ├── ShutdownSwitchResource.java │ │ │ │ │ ├── SlotSyncResource.java │ │ │ │ │ ├── SlotTableResource.java │ │ │ │ │ ├── StopPushDataResource.java │ │ │ │ │ └── filter │ │ │ │ │ │ ├── AuthRestController.java │ │ │ │ │ │ ├── AuthRestFilter.java │ │ │ │ │ │ ├── LeaderAwareFilter.java │ │ │ │ │ │ ├── LeaderAwareRestController.java │ │ │ │ │ │ ├── LeaderForwardFilter.java │ │ │ │ │ │ └── LeaderForwardRestController.java │ │ │ │ │ └── slot │ │ │ │ │ ├── RebalanceTask.java │ │ │ │ │ ├── SlotAllocator.java │ │ │ │ │ ├── SlotAssigner.java │ │ │ │ │ ├── SlotBalancer.java │ │ │ │ │ ├── SlotManager.java │ │ │ │ │ ├── SlotTableAware.java │ │ │ │ │ ├── arrange │ │ │ │ │ └── ScheduledSlotArranger.java │ │ │ │ │ ├── assigner │ │ │ │ │ ├── DefaultSlotAssigner.java │ │ │ │ │ └── ScoreStrategy.java │ │ │ │ │ ├── balance │ │ │ │ │ ├── BalancePolicy.java │ │ │ │ │ ├── DefaultSlotBalancer.java │ │ │ │ │ ├── LeaderOnlyBalancer.java │ │ │ │ │ └── NaiveBalancePolicy.java │ │ │ │ │ ├── manager │ │ │ │ │ ├── DefaultSlotManager.java │ │ │ │ │ └── SimpleSlotManager.java │ │ │ │ │ ├── status │ │ │ │ │ └── SlotTableStatusService.java │ │ │ │ │ ├── tasks │ │ │ │ │ └── BalanceTask.java │ │ │ │ │ └── util │ │ │ │ │ ├── MigrateSlotGroup.java │ │ │ │ │ ├── builder │ │ │ │ │ ├── Builder.java │ │ │ │ │ ├── SlotBuilder.java │ │ │ │ │ └── SlotTableBuilder.java │ │ │ │ │ ├── comparator │ │ │ │ │ ├── Comparators.java │ │ │ │ │ └── SortType.java │ │ │ │ │ └── selector │ │ │ │ │ ├── Selector.java │ │ │ │ │ └── Selectors.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── log4j2.xml │ │ │ │ └── security │ │ │ │ └── blacklist.txt │ │ │ └── test │ │ │ ├── java │ │ │ └── com │ │ │ │ └── alipay │ │ │ │ └── sofa │ │ │ │ └── registry │ │ │ │ ├── AllTests.java │ │ │ │ ├── common │ │ │ │ └── model │ │ │ │ │ └── slot │ │ │ │ │ ├── BaseSlotFunctionTest.java │ │ │ │ │ └── Crc32CSlotFunctionTest.java │ │ │ │ ├── server │ │ │ │ ├── meta │ │ │ │ │ ├── AbstractH2DbTestBase.java │ │ │ │ │ ├── AbstractMetaHttpResourceTestBase.java │ │ │ │ │ ├── AbstractMetaServerTestBase.java │ │ │ │ │ ├── AbstractTestBase.java │ │ │ │ │ ├── cleaner │ │ │ │ │ │ ├── AppRevisionCleanerTest.java │ │ │ │ │ │ └── InterfaceAppsIndexCleanerTest.java │ │ │ │ │ ├── cluster │ │ │ │ │ │ └── node │ │ │ │ │ │ │ ├── NodeModifiedTest.java │ │ │ │ │ │ │ └── TestAbstractNodeEventTest.java │ │ │ │ │ ├── lease │ │ │ │ │ │ ├── LeaseTest.java │ │ │ │ │ │ ├── data │ │ │ │ │ │ │ └── DefaultDataServerManagerTest.java │ │ │ │ │ │ ├── filter │ │ │ │ │ │ │ └── DefaultRegistryForbiddenServerManagerTest.java │ │ │ │ │ │ ├── impl │ │ │ │ │ │ │ ├── AbstractEvictableFilterableLeaseManagerTest.java │ │ │ │ │ │ │ ├── LeaderAwareLeaseManagerTest.java │ │ │ │ │ │ │ ├── SimpleLeaseManagerTest.java │ │ │ │ │ │ │ ├── TestAbstractEvictableLeaseManagerTest.java │ │ │ │ │ │ │ └── TestAbstractRaftEnabledLeaseManager.java │ │ │ │ │ │ └── session │ │ │ │ │ │ │ └── DefaultSessionServerManagerTest.java │ │ │ │ │ ├── metaserver │ │ │ │ │ │ └── impl │ │ │ │ │ │ │ ├── DefaultCurrentDcMetaServerTest.java │ │ │ │ │ │ │ ├── DefaultMetaLeaderElectorTest.java │ │ │ │ │ │ │ ├── DefaultMetaServerManagerTest.java │ │ │ │ │ │ │ └── LocalMetaServerTest.java │ │ │ │ │ ├── monitor │ │ │ │ │ │ ├── DefaultSlotTableMonitorTest.java │ │ │ │ │ │ ├── data │ │ │ │ │ │ │ └── DataServerStatsTest.java │ │ │ │ │ │ └── impl │ │ │ │ │ │ │ ├── DefaultSlotStatsTest.java │ │ │ │ │ │ │ └── DefaultSlotTableStatsTest.java │ │ │ │ │ ├── multi │ │ │ │ │ │ └── cluster │ │ │ │ │ │ │ ├── DefaultMultiClusterSlotTableSyncerTest.java │ │ │ │ │ │ │ └── remote │ │ │ │ │ │ │ └── RemoteClusterSlotSyncHandlerTest.java │ │ │ │ │ ├── provide │ │ │ │ │ │ └── data │ │ │ │ │ │ │ ├── ClientManagerServiceTest.java │ │ │ │ │ │ │ └── DefaultProvideDataNotifierTest.java │ │ │ │ │ ├── remoting │ │ │ │ │ │ ├── data │ │ │ │ │ │ │ └── DefaultDataServerServiceTest.java │ │ │ │ │ │ ├── handler │ │ │ │ │ │ │ ├── FetchSystemPropertyRequestHandlerTest.java │ │ │ │ │ │ │ └── HeartbeatRequestHandlerTest.java │ │ │ │ │ │ ├── notifier │ │ │ │ │ │ │ └── AbstractNotifierTest.java │ │ │ │ │ │ └── session │ │ │ │ │ │ │ └── DefaultSessionServerServiceTest.java │ │ │ │ │ ├── resource │ │ │ │ │ │ ├── BlacklistDataResourceTest.java │ │ │ │ │ │ ├── CircuitBreakerResourcesTest.java │ │ │ │ │ │ ├── CleanerResourceTest.java │ │ │ │ │ │ ├── ClientManagerResourceTest.java │ │ │ │ │ │ ├── CompressResourceTest.java │ │ │ │ │ │ ├── DataInfoIDBlacklistResourceTest.java │ │ │ │ │ │ ├── HealthResourceTest.java │ │ │ │ │ │ ├── MetaCenterResourceTest.java │ │ │ │ │ │ ├── MetaDigestResourceTest.java │ │ │ │ │ │ ├── MetaLeaderResourceTest.java │ │ │ │ │ │ ├── MultiClusterSyncResourceTest.java │ │ │ │ │ │ ├── ProvideDataResourceTest.java │ │ │ │ │ │ ├── RegistryCoreOpsResourceTest.java │ │ │ │ │ │ ├── ShutdownSwitchResourceTest.java │ │ │ │ │ │ ├── SlotSyncResourceTest.java │ │ │ │ │ │ ├── SlotTableResourceTest.java │ │ │ │ │ │ ├── StopPushDataResourceTest.java │ │ │ │ │ │ └── filter │ │ │ │ │ │ │ ├── LeaderAwareFilterTest.java │ │ │ │ │ │ │ └── LeaderForwardFilterTest.java │ │ │ │ │ └── slot │ │ │ │ │ │ ├── arrange │ │ │ │ │ │ └── ScheduledSlotArrangerTest.java │ │ │ │ │ │ ├── assigner │ │ │ │ │ │ └── DefaultSlotAssignerTest.java │ │ │ │ │ │ ├── balance │ │ │ │ │ │ ├── DefaultSlotBalancerTest.java │ │ │ │ │ │ └── LeaderOnlyBalancerTest.java │ │ │ │ │ │ ├── chaos │ │ │ │ │ │ ├── CheckerAction.java │ │ │ │ │ │ ├── InjectionAction.java │ │ │ │ │ │ └── SlotChaosTest.java │ │ │ │ │ │ ├── manager │ │ │ │ │ │ ├── DefaultSlotManagerTest.java │ │ │ │ │ │ └── SimpleSlotManagerTest.java │ │ │ │ │ │ ├── tasks │ │ │ │ │ │ ├── BalanceTaskTest.java │ │ │ │ │ │ └── SlotMigrationIntegrationTest.java │ │ │ │ │ │ └── util │ │ │ │ │ │ ├── ListUtil.java │ │ │ │ │ │ ├── MigrateSlotGroupTest.java │ │ │ │ │ │ ├── NodeComparatorTest.java │ │ │ │ │ │ ├── SlotBuilderTest.java │ │ │ │ │ │ └── SlotTableBuilderTest.java │ │ │ │ └── shared │ │ │ │ │ └── slot │ │ │ │ │ └── DiskSlotTableRecorderTest.java │ │ │ │ └── test │ │ │ │ └── TestUtils.java │ │ │ └── resources │ │ │ ├── application-test.properties │ │ │ ├── log4j2.xml │ │ │ ├── sql │ │ │ └── h2 │ │ │ │ ├── base_info.sql │ │ │ │ └── create_table.sql │ │ │ └── test │ │ │ ├── slot-table-2.json │ │ │ └── slot-table.json │ ├── pom.xml │ ├── session │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── alipay │ │ │ │ │ └── sofa │ │ │ │ │ └── registry │ │ │ │ │ └── server │ │ │ │ │ └── session │ │ │ │ │ ├── SessionApplication.java │ │ │ │ │ ├── acceptor │ │ │ │ │ ├── ClientOffWriteDataRequest.java │ │ │ │ │ ├── PublisherWriteDataRequest.java │ │ │ │ │ ├── WriteDataAcceptor.java │ │ │ │ │ ├── WriteDataAcceptorImpl.java │ │ │ │ │ ├── WriteDataProcessor.java │ │ │ │ │ └── WriteDataRequest.java │ │ │ │ │ ├── bootstrap │ │ │ │ │ ├── ExecutorManager.java │ │ │ │ │ ├── MultiClusterSessionConfiguration.java │ │ │ │ │ ├── MultiClusterSessionServerConfig.java │ │ │ │ │ ├── MultiClusterSessionServerConfigBean.java │ │ │ │ │ ├── SessionServerBootstrap.java │ │ │ │ │ ├── SessionServerConfig.java │ │ │ │ │ ├── SessionServerConfigBean.java │ │ │ │ │ ├── SessionServerConfiguration.java │ │ │ │ │ └── SessionServerInitializer.java │ │ │ │ │ ├── cache │ │ │ │ │ ├── CacheAccessException.java │ │ │ │ │ ├── CacheGenerator.java │ │ │ │ │ ├── CacheService.java │ │ │ │ │ ├── DatumCacheGenerator.java │ │ │ │ │ ├── DatumKey.java │ │ │ │ │ ├── EntityType.java │ │ │ │ │ ├── Key.java │ │ │ │ │ ├── SessionCacheService.java │ │ │ │ │ ├── SessionDatumCacheService.java │ │ │ │ │ └── Value.java │ │ │ │ │ ├── circuit │ │ │ │ │ └── breaker │ │ │ │ │ │ ├── CircuitBreakerService.java │ │ │ │ │ │ └── DefaultCircuitBreakerService.java │ │ │ │ │ ├── client │ │ │ │ │ └── manager │ │ │ │ │ │ └── CheckClientManagerService.java │ │ │ │ │ ├── connections │ │ │ │ │ └── ConnectionsService.java │ │ │ │ │ ├── converter │ │ │ │ │ ├── Converter.java │ │ │ │ │ ├── LocalDataCenterPushData.java │ │ │ │ │ ├── PublisherConverter.java │ │ │ │ │ ├── ReceivedDataConverter.java │ │ │ │ │ ├── SegmentDataCounter.java │ │ │ │ │ ├── SubscriberConverter.java │ │ │ │ │ └── pb │ │ │ │ │ │ ├── AppRevisionConvertor.java │ │ │ │ │ │ ├── DataBoxConvertor.java │ │ │ │ │ │ ├── ListStringConvertor.java │ │ │ │ │ │ ├── MetaServiceConvertor.java │ │ │ │ │ │ ├── PublisherRegisterConvertor.java │ │ │ │ │ │ ├── ReceivedDataConvertor.java │ │ │ │ │ │ ├── RegisterResponseConvertor.java │ │ │ │ │ │ ├── SubscriberRegisterConvertor.java │ │ │ │ │ │ ├── SyncConfigRequestConvertor.java │ │ │ │ │ │ └── SyncConfigResponseConvertor.java │ │ │ │ │ ├── filter │ │ │ │ │ ├── IPMatchStrategy.java │ │ │ │ │ ├── ProcessFilter.java │ │ │ │ │ └── blacklist │ │ │ │ │ │ ├── BlacklistConfig.java │ │ │ │ │ │ ├── BlacklistConstants.java │ │ │ │ │ │ ├── BlacklistMatchProcessFilter.java │ │ │ │ │ │ ├── DefaultIPMatchStrategy.java │ │ │ │ │ │ └── MatchType.java │ │ │ │ │ ├── limit │ │ │ │ │ ├── AccessLimitService.java │ │ │ │ │ └── AccessLimitServiceImpl.java │ │ │ │ │ ├── loggers │ │ │ │ │ └── Loggers.java │ │ │ │ │ ├── mapper │ │ │ │ │ └── ConnectionMapper.java │ │ │ │ │ ├── metadata │ │ │ │ │ ├── MetadataCacheMetrics.java │ │ │ │ │ └── MetadataCacheRegistry.java │ │ │ │ │ ├── multi │ │ │ │ │ └── cluster │ │ │ │ │ │ ├── DataCenterMetadataCache.java │ │ │ │ │ │ └── DataCenterMetadataCacheImpl.java │ │ │ │ │ ├── node │ │ │ │ │ └── service │ │ │ │ │ │ ├── ClientNodeService.java │ │ │ │ │ │ ├── ClientNodeServiceImpl.java │ │ │ │ │ │ ├── DataNodeService.java │ │ │ │ │ │ ├── DataNodeServiceImpl.java │ │ │ │ │ │ ├── MetaServerServiceImpl.java │ │ │ │ │ │ └── SessionMetaServerManager.java │ │ │ │ │ ├── predicate │ │ │ │ │ └── ZonePredicate.java │ │ │ │ │ ├── providedata │ │ │ │ │ ├── AppRevisionWriteSwitchService.java │ │ │ │ │ ├── CompressPushService.java │ │ │ │ │ ├── ConfigProvideDataWatcher.java │ │ │ │ │ ├── FetchBlackListService.java │ │ │ │ │ ├── FetchCircuitBreakerService.java │ │ │ │ │ ├── FetchClientOffAddressService.java │ │ │ │ │ ├── FetchDataInfoIDBlackListService.java │ │ │ │ │ ├── FetchGrayPushSwitchService.java │ │ │ │ │ ├── FetchPushEfficiencyConfigService.java │ │ │ │ │ ├── FetchShutdownService.java │ │ │ │ │ ├── FetchStopPushService.java │ │ │ │ │ └── ProvideDataProcessorManager.java │ │ │ │ │ ├── push │ │ │ │ │ ├── ChangeProcessor.java │ │ │ │ │ ├── FirePushService.java │ │ │ │ │ ├── PushCause.java │ │ │ │ │ ├── PushDataGenerator.java │ │ │ │ │ ├── PushEfficiencyImproveConfig.java │ │ │ │ │ ├── PushLog.java │ │ │ │ │ ├── PushMetrics.java │ │ │ │ │ ├── PushProcessor.java │ │ │ │ │ ├── PushSwitchService.java │ │ │ │ │ ├── PushTask.java │ │ │ │ │ ├── PushTaskBuffer.java │ │ │ │ │ ├── PushTrace.java │ │ │ │ │ ├── PushType.java │ │ │ │ │ ├── RegProcessor.java │ │ │ │ │ ├── TriggerPushContext.java │ │ │ │ │ └── WatchProcessor.java │ │ │ │ │ ├── registry │ │ │ │ │ ├── ClientManagerMetric.java │ │ │ │ │ ├── Registry.java │ │ │ │ │ ├── RegistryScanCallable.java │ │ │ │ │ └── SessionRegistry.java │ │ │ │ │ ├── remoting │ │ │ │ │ ├── ClientNodeExchanger.java │ │ │ │ │ ├── DataNodeExchanger.java │ │ │ │ │ ├── DataNodeNotifyExchanger.java │ │ │ │ │ ├── console │ │ │ │ │ │ ├── SessionConsoleExchanger.java │ │ │ │ │ │ └── handler │ │ │ │ │ │ │ ├── AbstractConsoleHandler.java │ │ │ │ │ │ │ ├── CheckClientManagerHandler.java │ │ │ │ │ │ │ ├── ClientOffRequestHandler.java │ │ │ │ │ │ │ ├── ClientOnRequestHandler.java │ │ │ │ │ │ │ ├── FilterSubscriberIPsHandler.java │ │ │ │ │ │ │ ├── GetClientManagerRequestHandler.java │ │ │ │ │ │ │ ├── PubSubDataInfoIdRequestHandler.java │ │ │ │ │ │ │ ├── QueryPublisherRequestHandler.java │ │ │ │ │ │ │ ├── QuerySubscriberCountByAppRequestHandler.java │ │ │ │ │ │ │ ├── QuerySubscriberRequestHandler.java │ │ │ │ │ │ │ └── StopPushRequestHandler.java │ │ │ │ │ └── handler │ │ │ │ │ │ ├── AbstractClientDataRequestHandler.java │ │ │ │ │ │ ├── AbstractClientMetadataRequestHandler.java │ │ │ │ │ │ ├── AppRevisionSliceHandler.java │ │ │ │ │ │ ├── ClientNodeConnectionHandler.java │ │ │ │ │ │ ├── DataChangeRequestHandler.java │ │ │ │ │ │ ├── DataPushRequestHandler.java │ │ │ │ │ │ ├── DataSlotDiffDigestRequestHandler.java │ │ │ │ │ │ ├── DataSlotDiffPublisherRequestHandler.java │ │ │ │ │ │ ├── GetRevisionPbHandler.java │ │ │ │ │ │ ├── MetaRevisionHeartbeatPbHandler.java │ │ │ │ │ │ ├── MetadataRegisterPbHandler.java │ │ │ │ │ │ ├── NotifyProvideDataChangeHandler.java │ │ │ │ │ │ ├── PublisherHandler.java │ │ │ │ │ │ ├── PublisherPbHandler.java │ │ │ │ │ │ ├── ServiceAppMappingPbHandler.java │ │ │ │ │ │ ├── SubscriberHandler.java │ │ │ │ │ │ ├── SubscriberPbHandler.java │ │ │ │ │ │ ├── SyncConfigHandler.java │ │ │ │ │ │ ├── SyncConfigPbHandler.java │ │ │ │ │ │ └── WatcherHandler.java │ │ │ │ │ ├── resource │ │ │ │ │ ├── ClientManagerResource.java │ │ │ │ │ ├── ClientsOpenResource.java │ │ │ │ │ ├── CompressResource.java │ │ │ │ │ ├── ConnectionsResource.java │ │ │ │ │ ├── EmergencyApiResource.java │ │ │ │ │ ├── HealthResource.java │ │ │ │ │ ├── MetadataCacheResource.java │ │ │ │ │ ├── PersistenceClientManagerResource.java │ │ │ │ │ ├── Sdks.java │ │ │ │ │ ├── SessionDigestResource.java │ │ │ │ │ ├── SessionOpenResource.java │ │ │ │ │ └── SlotTableStatusResource.java │ │ │ │ │ ├── scheduler │ │ │ │ │ └── timertask │ │ │ │ │ │ ├── CacheCountTask.java │ │ │ │ │ │ ├── Metrics.java │ │ │ │ │ │ ├── SessionCacheDigestTask.java │ │ │ │ │ │ └── SyncClientsHeartbeatTask.java │ │ │ │ │ ├── slot │ │ │ │ │ ├── SlotTableCache.java │ │ │ │ │ └── SlotTableCacheImpl.java │ │ │ │ │ ├── store │ │ │ │ │ ├── AbstractDataManager.java │ │ │ │ │ ├── DataIndexer.java │ │ │ │ │ ├── DataManager.java │ │ │ │ │ ├── DataPos.java │ │ │ │ │ ├── DataStore.java │ │ │ │ │ ├── FetchPubSubDataInfoIdService.java │ │ │ │ │ ├── Interests.java │ │ │ │ │ ├── SessionDataStore.java │ │ │ │ │ ├── SessionInterests.java │ │ │ │ │ ├── SessionWatchers.java │ │ │ │ │ ├── SimpleStore.java │ │ │ │ │ ├── SlotStore.java │ │ │ │ │ ├── Store.java │ │ │ │ │ └── Watchers.java │ │ │ │ │ ├── strategy │ │ │ │ │ ├── AppRevisionHandlerStrategy.java │ │ │ │ │ ├── PublisherHandlerStrategy.java │ │ │ │ │ ├── SessionRegistryStrategy.java │ │ │ │ │ ├── SubscriberHandlerStrategy.java │ │ │ │ │ ├── SyncConfigHandlerStrategy.java │ │ │ │ │ ├── WatcherHandlerStrategy.java │ │ │ │ │ └── impl │ │ │ │ │ │ ├── DefaultAppRevisionHandlerStrategy.java │ │ │ │ │ │ ├── DefaultPublisherHandlerStrategy.java │ │ │ │ │ │ ├── DefaultSessionRegistryStrategy.java │ │ │ │ │ │ ├── DefaultSubscriberHandlerStrategy.java │ │ │ │ │ │ ├── DefaultSyncConfigHandlerStrategy.java │ │ │ │ │ │ ├── DefaultWatcherHandlerStrategy.java │ │ │ │ │ │ ├── Metrics.java │ │ │ │ │ │ └── RegisterLogs.java │ │ │ │ │ └── wrapper │ │ │ │ │ ├── AccessLimitWrapperInterceptor.java │ │ │ │ │ ├── BlacklistWrapperInterceptor.java │ │ │ │ │ ├── ClientCheckWrapperInterceptor.java │ │ │ │ │ ├── ClientOffWrapperInterceptor.java │ │ │ │ │ ├── DataInfoIDBlacklistWrapperInterceptor.java │ │ │ │ │ ├── RegisterInvokeData.java │ │ │ │ │ └── WrapperInterceptorManager.java │ │ │ └── resources │ │ │ │ ├── application.properties │ │ │ │ ├── banner.txt │ │ │ │ ├── log4j2.xml │ │ │ │ └── security │ │ │ │ └── blacklist.txt │ │ │ └── test │ │ │ ├── java │ │ │ └── com │ │ │ │ └── alipay │ │ │ │ └── sofa │ │ │ │ └── registry │ │ │ │ └── server │ │ │ │ └── session │ │ │ │ ├── AbstractSessionServerTestBase.java │ │ │ │ ├── AbstractTestBase.java │ │ │ │ ├── AllTests.java │ │ │ │ ├── TestUtils.java │ │ │ │ ├── WrapperInvocationTest.java │ │ │ │ ├── acceptor │ │ │ │ └── WriteDataProcessorTest.java │ │ │ │ ├── cache │ │ │ │ └── SessionCacheServiceTest.java │ │ │ │ ├── circuit │ │ │ │ └── breaker │ │ │ │ │ └── CircuitBreakerServiceTest.java │ │ │ │ ├── connections │ │ │ │ └── ConnectionsServiceTest.java │ │ │ │ ├── converter │ │ │ │ ├── PublisherConverterTest.java │ │ │ │ ├── ReceivedDataConverterTest.java │ │ │ │ ├── SubscriberConverterTest.java │ │ │ │ └── pb │ │ │ │ │ ├── AppRevisionConvertorTest.java │ │ │ │ │ ├── BoltEncodeTest.java │ │ │ │ │ ├── PublisherRegisterConvertorTest.java │ │ │ │ │ ├── ReceivedDataConvertorTest.java │ │ │ │ │ ├── RegisterResponseConvertorTest.java │ │ │ │ │ ├── SubscriberRegisterConvertorTest.java │ │ │ │ │ ├── SyncConfigRequestConvertorTest.java │ │ │ │ │ └── SyncConfigResponseConvertorTest.java │ │ │ │ ├── filter │ │ │ │ └── blacklist │ │ │ │ │ └── DefaultIPMatchStrategyTest.java │ │ │ │ ├── mapper │ │ │ │ └── ConnectionMapperTest.java │ │ │ │ ├── metadata │ │ │ │ └── MetadataCacheRegistryTest.java │ │ │ │ ├── node │ │ │ │ └── service │ │ │ │ │ ├── MetaServerServiceImplTest.java │ │ │ │ │ └── SessionMetaServerManagerTest.java │ │ │ │ ├── predicate │ │ │ │ └── ZonePredicateTest.java │ │ │ │ ├── providedata │ │ │ │ ├── AppRevisionWriteSwitchServiceTest.java │ │ │ │ ├── CompressPushServiceTest.java │ │ │ │ ├── ConfigProvideDataWatcherTest.java │ │ │ │ ├── FetchBlackListTest.java │ │ │ │ ├── FetchCircuitBreakerServiceTest.java │ │ │ │ ├── FetchClientOffServiceTest.java │ │ │ │ ├── FetchDataInfoIDBlackListServiceTest.java │ │ │ │ ├── FetchGrayPushServiceTest.java │ │ │ │ ├── FetchPushEfficiencyConfigServiceTest.java │ │ │ │ ├── FetchShutdownServiceTest.java │ │ │ │ ├── FetchStopPushServiceTest.java │ │ │ │ ├── FetchSystemPropertyTest.java │ │ │ │ └── ProvideDataProcessorManagerTest.java │ │ │ │ ├── push │ │ │ │ ├── ChangeProcessorTest.java │ │ │ │ ├── FirePushServiceTest.java │ │ │ │ ├── PushDataGeneratorTest.java │ │ │ │ ├── PushEfficiencyImproveConfigTest.java │ │ │ │ ├── PushProcessorTest.java │ │ │ │ ├── PushSwitchServiceTest.java │ │ │ │ ├── PushTaskBufferTest.java │ │ │ │ ├── PushTraceTest.java │ │ │ │ ├── RegProcessorTest.java │ │ │ │ ├── TriggerPushContextTest.java │ │ │ │ └── WatchProcessorTest.java │ │ │ │ ├── remoting │ │ │ │ ├── console │ │ │ │ │ └── handler │ │ │ │ │ │ ├── ClientOffRequestHandlerTest.java │ │ │ │ │ │ ├── ClientOnRequestHandlerTest.java │ │ │ │ │ │ ├── FilterSubscriberIPsHandlerTest.java │ │ │ │ │ │ ├── QueryPublisherRequestHandlerTest.java │ │ │ │ │ │ ├── QuerySubscriberCountByAppRequestHandlerTest.java │ │ │ │ │ │ └── QuerySubscriberRequestHandlerTest.java │ │ │ │ └── handler │ │ │ │ │ ├── AppRevisionSliceHandlerTest.java │ │ │ │ │ ├── ClientNodeConnectionHandlerTest.java │ │ │ │ │ ├── DataChangeRequestHandlerTest.java │ │ │ │ │ ├── DataPushRequestHandlerTest.java │ │ │ │ │ ├── DataSlotDiffDigestRequestHandlerTest.java │ │ │ │ │ ├── DataSlotDiffPublisherRequestHandlerTest.java │ │ │ │ │ ├── GetRevisionPbHandlerTest.java │ │ │ │ │ ├── MetaRevisionHeartbeatPbHandlerTest.java │ │ │ │ │ ├── MetadataRegisterPbHandlerTest.java │ │ │ │ │ ├── NotifyProvideDataChangeHandlerTest.java │ │ │ │ │ ├── PublisherHandlerTest.java │ │ │ │ │ ├── ServiceAppMappingPbHandlerTest.java │ │ │ │ │ ├── SubscriberHandlerTest.java │ │ │ │ │ ├── SyncConfigHandlerTest.java │ │ │ │ │ └── WatcherHandlerTest.java │ │ │ │ ├── resource │ │ │ │ ├── CompressResourceTest.java │ │ │ │ ├── HealthResourceTest.java │ │ │ │ ├── SdksTest.java │ │ │ │ └── SessionDigestResourceTest.java │ │ │ │ ├── scheduler │ │ │ │ └── timertask │ │ │ │ │ └── CacheTaskTest.java │ │ │ │ ├── slot │ │ │ │ └── SlotTableCacheImplTest.java │ │ │ │ ├── store │ │ │ │ ├── BaseTest.java │ │ │ │ ├── DataCacheTest.java │ │ │ │ ├── SessionDataStoreTest.java │ │ │ │ ├── SessionInterestsTest.java │ │ │ │ └── StorePerformanceTest.java │ │ │ │ ├── strategy │ │ │ │ └── impl │ │ │ │ │ ├── DefaultSessionRegistryStrategyTest.java │ │ │ │ │ └── MetricsTest.java │ │ │ │ └── wrapper │ │ │ │ └── DataInfoIDBlacklistWrapperInterceptorTest.java │ │ │ └── resources │ │ │ └── log4j2.xml │ └── shared │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── alipay │ │ │ └── sofa │ │ │ └── registry │ │ │ └── server │ │ │ └── shared │ │ │ ├── client │ │ │ └── manager │ │ │ │ ├── BaseClientManagerService.java │ │ │ │ └── ClientManagerService.java │ │ │ ├── comparator │ │ │ ├── AbstractComparator.java │ │ │ ├── Comparator.java │ │ │ └── NodeComparator.java │ │ │ ├── config │ │ │ ├── CommonConfig.java │ │ │ └── ServerShareConfig.java │ │ │ ├── constant │ │ │ └── MetaLeaderLearnModeEnum.java │ │ │ ├── env │ │ │ └── ServerEnv.java │ │ │ ├── meta │ │ │ ├── AbstractMetaLeaderExchanger.java │ │ │ ├── AbstractMetaServerService.java │ │ │ ├── MetaLeaderExchanger.java │ │ │ └── MetaServerService.java │ │ │ ├── providedata │ │ │ ├── AbstractFetchPersistenceSystemProperty.java │ │ │ ├── AbstractFetchSystemPropertyService.java │ │ │ ├── AbstractProvideDataWatcher.java │ │ │ ├── BaseStopPushService.java │ │ │ ├── FetchSystemPropertyService.java │ │ │ ├── ProvideDataProcessor.java │ │ │ ├── SystemDataStorage.java │ │ │ └── SystemPropertyProcessorManager.java │ │ │ ├── remoting │ │ │ ├── AbstractChannelHandler.java │ │ │ ├── AbstractClientHandler.java │ │ │ ├── AbstractServerHandler.java │ │ │ ├── ClientSideExchanger.java │ │ │ ├── ListenServerChannelHandler.java │ │ │ ├── RemotingHelper.java │ │ │ ├── ServerSideExchanger.java │ │ │ └── SlotTableChangeEventHandler.java │ │ │ ├── resource │ │ │ ├── AuthChecker.java │ │ │ ├── MetricsResource.java │ │ │ ├── RegistryOpsResource.java │ │ │ ├── SlotGenericResource.java │ │ │ └── VersionResource.java │ │ │ ├── slot │ │ │ ├── DiskSlotTableRecorder.java │ │ │ ├── SlotTableRecorder.java │ │ │ └── SlotTableUtils.java │ │ │ └── util │ │ │ ├── DatumUtils.java │ │ │ ├── NodeUtils.java │ │ │ └── PersistenceDataParser.java │ │ └── test │ │ └── java │ │ └── com │ │ └── alipay │ │ └── sofa │ │ └── registry │ │ └── server │ │ └── shared │ │ ├── TestUtils.java │ │ ├── comparator │ │ └── ComparatorTest.java │ │ ├── env │ │ └── ServerEnvTest.java │ │ ├── meta │ │ ├── MetaLeaderExchangerTest.java │ │ ├── MetaServerServiceTest.java │ │ └── MockJdbcMetaLeaderExchanger.java │ │ ├── providedata │ │ ├── AbstractFetchSystemPropertyServiceTest.java │ │ └── AbstractProvideDataWatcherTest.java │ │ ├── remoting │ │ ├── ChannelHandlerTest.java │ │ ├── ListenServerChannelHandlerTest.java │ │ └── SlotTableChangeEventHandlerTest.java │ │ ├── resource │ │ ├── MetricsResourceTest.java │ │ ├── RegistryOpsResourceTest.java │ │ └── SlotGenericResourceTest.java │ │ ├── slot │ │ └── SlotTableUtilsTest.java │ │ └── util │ │ ├── DatumUtilsTest.java │ │ └── NodeUtilsTest.java └── store │ ├── api │ ├── pom.xml │ └── src │ │ ├── main │ │ └── java │ │ │ └── com │ │ │ └── alipay │ │ │ └── sofa │ │ │ └── registry │ │ │ └── store │ │ │ └── api │ │ │ ├── DBResponse.java │ │ │ ├── OperationStatus.java │ │ │ ├── annotation │ │ │ └── ReadOnLeader.java │ │ │ ├── config │ │ │ ├── DefaultCommonConfig.java │ │ │ ├── DefaultCommonConfigBean.java │ │ │ └── StoreApiConfiguration.java │ │ │ ├── date │ │ │ └── DateNowRepository.java │ │ │ ├── elector │ │ │ ├── AbstractLeaderElector.java │ │ │ ├── DistributeLockRepository.java │ │ │ ├── LeaderAware.java │ │ │ └── LeaderElector.java │ │ │ ├── meta │ │ │ ├── ClientManagerAddressRepository.java │ │ │ ├── DbEntry.java │ │ │ ├── MultiClusterSyncRepository.java │ │ │ ├── ProvideDataRepository.java │ │ │ ├── RecoverConfig.java │ │ │ └── RecoverConfigRepository.java │ │ │ ├── multi │ │ │ └── MultiDataCenterListener.java │ │ │ ├── repository │ │ │ ├── AppRevisionRepository.java │ │ │ └── InterfaceAppsRepository.java │ │ │ └── spring │ │ │ └── SpringContext.java │ │ └── test │ │ └── java │ │ └── com │ │ └── alipay │ │ └── sofa │ │ └── registry │ │ └── store │ │ └── api │ │ └── DBResponseTest.java │ ├── jdbc │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── alipay │ │ │ │ └── sofa │ │ │ │ └── registry │ │ │ │ └── jdbc │ │ │ │ ├── config │ │ │ │ ├── JdbcConfiguration.java │ │ │ │ ├── JdbcDriverConfig.java │ │ │ │ ├── JdbcDriverConfigBean.java │ │ │ │ ├── JdbcElectorConfiguration.java │ │ │ │ ├── MetaElectorConfig.java │ │ │ │ ├── MetaElectorConfigBean.java │ │ │ │ ├── MetadataConfig.java │ │ │ │ └── MetadataConfigBean.java │ │ │ │ ├── constant │ │ │ │ └── TableEnum.java │ │ │ │ ├── convertor │ │ │ │ ├── AppRevisionDomainConvertor.java │ │ │ │ ├── MultiClusterSyncConvertor.java │ │ │ │ └── ProvideDataDomainConvertor.java │ │ │ │ ├── domain │ │ │ │ ├── AppRevisionDomain.java │ │ │ │ ├── ClientManagerAddressDomain.java │ │ │ │ ├── DateNowDomain.java │ │ │ │ ├── FollowCompeteLockDomain.java │ │ │ │ ├── InterfaceAppsIndexDomain.java │ │ │ │ ├── MultiClusterSyncDomain.java │ │ │ │ ├── ProvideDataDomain.java │ │ │ │ └── RecoverConfigDomain.java │ │ │ │ ├── elector │ │ │ │ └── MetaJdbcLeaderElector.java │ │ │ │ ├── exception │ │ │ │ ├── AppRevisionQueryException.java │ │ │ │ ├── InterfaceAppQueryException.java │ │ │ │ └── RevisionNotExistException.java │ │ │ │ ├── informer │ │ │ │ ├── BaseInformer.java │ │ │ │ └── DbEntryContainer.java │ │ │ │ ├── mapper │ │ │ │ ├── AppRevisionMapper.java │ │ │ │ ├── ClientManagerAddressMapper.java │ │ │ │ ├── DateNowMapper.java │ │ │ │ ├── DistributeLockMapper.java │ │ │ │ ├── InterfaceAppsIndexMapper.java │ │ │ │ ├── MultiClusterSyncMapper.java │ │ │ │ ├── ProvideDataMapper.java │ │ │ │ └── RecoverConfigMapper.java │ │ │ │ ├── repository │ │ │ │ └── impl │ │ │ │ │ ├── AppRevisionContainer.java │ │ │ │ │ ├── AppRevisionJdbcRepository.java │ │ │ │ │ ├── ClientManagerAddressContainer.java │ │ │ │ │ ├── ClientManagerAddressJdbcRepository.java │ │ │ │ │ ├── DateNowJdbcRepository.java │ │ │ │ │ ├── DistributeLockJdbcRepository.java │ │ │ │ │ ├── InterfaceAppsIndexContainer.java │ │ │ │ │ ├── InterfaceAppsJdbcRepository.java │ │ │ │ │ ├── MetadataMetrics.java │ │ │ │ │ ├── MultiClusterSyncJdbcRepository.java │ │ │ │ │ ├── ProvideDataJdbcRepository.java │ │ │ │ │ └── RecoverConfigJdbcRepository.java │ │ │ │ └── version │ │ │ │ └── config │ │ │ │ ├── BaseConfigRepository.java │ │ │ │ └── ConfigEntry.java │ │ └── resources │ │ │ ├── application.properties │ │ │ ├── h2-mapper │ │ │ ├── app_revision.xml │ │ │ ├── client_manager_address.xml │ │ │ ├── date_now.xml │ │ │ ├── distribute_lock.xml │ │ │ ├── interface_apps_index.xml │ │ │ ├── multi_cluster_sync_info.xml │ │ │ ├── provide_data.xml │ │ │ └── recover_config.xml │ │ │ ├── mapper │ │ │ ├── app_revision.xml │ │ │ ├── client_manager_address.xml │ │ │ ├── date_now.xml │ │ │ ├── distribute_lock.xml │ │ │ ├── interface_apps_index.xml │ │ │ ├── multi_cluster_sync_info.xml │ │ │ ├── provide_data.xml │ │ │ └── recover_config.xml │ │ │ └── sql │ │ │ └── h2 │ │ │ ├── base_info.sql │ │ │ └── create_table.sql │ │ └── test │ │ ├── java │ │ └── com │ │ │ └── alipay │ │ │ └── sofa │ │ │ └── registry │ │ │ └── jdbc │ │ │ ├── AbstractH2DbTestBase.java │ │ │ ├── AbstractTest.java │ │ │ ├── TestUtils.java │ │ │ ├── cache │ │ │ └── HeartbeatCacheTest.java │ │ │ ├── convertor │ │ │ └── AppRevisionDomainConvertorTest.java │ │ │ ├── elector │ │ │ └── MetaJdbcLeaderElectorTest.java │ │ │ ├── repository │ │ │ └── impl │ │ │ │ ├── AppRevisionRepositoryTest.java │ │ │ │ ├── ClientManagerAddressJdbcRepositoryTest.java │ │ │ │ ├── DistributeLockJdbcRepositoryTest.java │ │ │ │ ├── InterfaceAppsIndexContainerTest.java │ │ │ │ ├── InterfaceAppsJdbcRepositoryTest.java │ │ │ │ ├── MultiClusterSyncJdbcRepositoryTest.java │ │ │ │ ├── ProvideDataJdbcRepositoryTest.java │ │ │ │ └── RecoverConfigRepositoryTest.java │ │ │ └── version │ │ │ └── cinfig │ │ │ └── BaseConfigRepositoryTest.java │ │ └── resources │ │ └── application-test.properties │ ├── jraft │ ├── pom.xml │ └── src │ │ └── main │ │ └── java │ │ └── com │ │ └── alipay │ │ └── sofa │ │ └── registry │ │ └── jraft │ │ ├── command │ │ ├── CommandCodec.java │ │ ├── ProcessRequest.java │ │ └── ProcessResponse.java │ │ ├── config │ │ └── RaftConfiguration.java │ │ ├── repository │ │ └── impl │ │ │ ├── AppRevisionRaftRepository.java │ │ │ └── InterfaceAppsRaftRepository.java │ │ └── revision │ │ ├── AppRevisionRegistry.java │ │ └── AppRevisionService.java │ └── pom.xml ├── test ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── alipay │ │ │ └── sofa │ │ │ └── registry │ │ │ └── server │ │ │ └── test │ │ │ └── TestRegistryMain.java │ └── resources │ │ ├── application.properties │ │ ├── log4j2.xml │ │ └── sql │ │ └── h2 │ │ ├── base_info.sql │ │ └── create_table.sql │ └── test │ ├── java │ └── com │ │ └── alipay │ │ └── sofa │ │ └── registry │ │ ├── server │ │ └── integration │ │ │ ├── RegistryConsumer.java │ │ │ └── RegistryProvider.java │ │ └── test │ │ ├── AbstractTest.java │ │ ├── BaseIntegrationTest.java │ │ ├── client │ │ ├── ClientManagerCheckVersionTest.java │ │ ├── ClientManagerTest.java │ │ ├── QueryClientOffTest.java │ │ └── SessionPersistenceClientManagerTest.java │ │ ├── mapper │ │ └── ConnectionMapperTest.java │ │ ├── metadata │ │ ├── InterfaceAppsJdbcRepositoryTest.java │ │ ├── MetadataHeartbeatTest.java │ │ └── MetadataTest.java │ │ ├── providedata │ │ ├── ProvideDataConfigTest.java │ │ └── ProvideDataTest.java │ │ ├── pubsub │ │ ├── PubSubTest.java │ │ ├── PushTest.java │ │ └── TempPublisherTest.java │ │ └── resource │ │ ├── HealthCheckTest.java │ │ ├── data │ │ ├── DataDigestResourceTest.java │ │ └── DatumApiResourceTest.java │ │ ├── meta │ │ ├── BlacklistTest.java │ │ ├── MetaDigestResourceTest.java │ │ ├── ProvideDataResourceTest.java │ │ └── StopPushDataSwitchTest.java │ │ └── session │ │ ├── ClientsManagerOpenResourceTest.java │ │ ├── ClientsOpenResourceTest.java │ │ ├── EmergencyApiResourceTest.java │ │ ├── SessionDigestResourceTest.java │ │ └── SessionOpenResourceTest.java │ └── resources │ ├── application-integrate.properties │ └── log4j2.xml └── tools ├── change_version.sh ├── check_format.sh └── codestyle └── HEADER /.github/ISSUE_TEMPLATE/Ask_Question.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Ask Question 3 | about: Ask a question about usage or feature 4 | 5 | --- 6 | 7 | ### Your question 8 | 9 | describe your question clearly 10 | 11 | ### Your scenes 12 | 13 | describe your use scenes (why need this feature) 14 | 15 | ### Your advice 16 | 17 | describe the advice or solution you'd like 18 | 19 | ### Environment 20 | 21 | - SOFARegistry version: 22 | - JVM version (e.g. `java -version`): 23 | - OS version (e.g. `uname -a`): 24 | - Maven version: 25 | - IDE version: 26 | 27 | 28 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/Bug_Report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug Report 3 | about: Create a report to help us improve 4 | 5 | --- 6 | 7 | ### Describe the bug 8 | 9 | A clear and concise description of what the bug is. 10 | 11 | ### Expected behavior 12 | 13 | ### Actual behavior 14 | 15 | ### Steps to reproduce 16 | 17 | ### Minimal yet complete reproducer code (or GitHub URL to code) 18 | 19 | ### Environment 20 | 21 | - SOFARegistry version: 22 | - JVM version (e.g. `java -version`): 23 | - OS version (e.g. `uname -a`): 24 | - Maven version: 25 | - IDE version: 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## In what area(s)? 11 | 12 | 13 | 14 | > /area runtime 15 | > /area operator 16 | > /area placement 17 | > /area docs 18 | > /area test-and-release 19 | 20 | ## Describe the feature 21 | 22 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Motivation: 2 | 3 | Explain the context, and why you're making that change. 4 | To make others understand what is the problem you're trying to solve. 5 | 6 | ### Modification: 7 | 8 | Describe the idea and modifications you've done. 9 | 10 | ### Result: 11 | 12 | Fixes #. 13 | 14 | If there is no issue then describe the changes introduced by this PR. 15 | -------------------------------------------------------------------------------- /.github/workflows/integration-test.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Maven 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven 3 | 4 | name: integration test 5 | 6 | on: 7 | push: 8 | branches: [ master ] 9 | pull_request: 10 | branches: [ master ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Set up JDK 1.8 20 | uses: actions/setup-java@v1 21 | with: 22 | java-version: 1.8 23 | - name: Integration Test 24 | run: mvn compile -B 25 | && mvn clean test -DisSkipUnitTest=true "-Dtest.logging.level=ERROR" 26 | - name: Publish Test Report 27 | if: ${{ always() }} 28 | uses: ScaCap/action-surefire-report@v1 29 | with: 30 | fail_on_test_failures: true 31 | skip_publishing: true 32 | 33 | -------------------------------------------------------------------------------- /.github/workflows/pmd.yml: -------------------------------------------------------------------------------- 1 | name: pmd 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | jobs: 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v2 15 | - name: Set up JDK 1.8 16 | uses: actions/setup-java@v1 17 | with: 18 | java-version: 1.8 19 | - name: PMD 20 | run: mvn install -Dmaven.test.skip=true 21 | && mvn pmd:check -------------------------------------------------------------------------------- /.github/workflows/unit-test.yml: -------------------------------------------------------------------------------- 1 | # This workflow will build a Java project with Maven 2 | # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven 3 | 4 | name: unit test 5 | 6 | on: 7 | push: 8 | branches: [ master ] 9 | pull_request: 10 | branches: [ master ] 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | timeout-minutes: 15 17 | 18 | steps: 19 | - uses: actions/checkout@v2 20 | - name: Set up JDK 1.8 21 | uses: actions/setup-java@v1 22 | with: 23 | java-version: 1.8 24 | - name: Unit Testt 25 | run: mvn compile -B 26 | && mvn clean test -DisSkipIntegrationTest=true "-Dtest.logging.level=ERROR" --fail-at-end --batch-mode 27 | - name: Upload heap dump 28 | if: always() 29 | uses: actions/upload-artifact@v4 30 | with: 31 | name: heap-dump 32 | path: /tmp/*.hprof 33 | - name: Publish Test Report 34 | if: ${{ always() }} 35 | uses: ScaCap/action-surefire-report@v1 36 | with: 37 | fail_on_test_failures: true 38 | skip_publishing: true 39 | - name: Codecov 40 | uses: codecov/codecov-action@v1 41 | with: 42 | token: ${{secrets.CODECOV_TOKEN}} 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Maven (examples) 2 | target 3 | dependency-reduced-pom.xml 4 | 5 | # IntelliJ IDEA 6 | .idea 7 | *.iml 8 | 9 | # Eclipse 10 | .classpath 11 | .project 12 | .settings 13 | 14 | # OS X 15 | .DS_Store 16 | 17 | # log 18 | logs/ 19 | *.log 20 | LOG_HOME_IS_UNDEFINED 21 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | sudo: false 3 | 4 | dist: trusty 5 | 6 | jdk: 7 | - oraclejdk8 8 | 9 | install: 10 | - mvn clean install -DskipTests -B -V 11 | - mvn test 12 | 13 | script: 14 | - sh ./tools/check_format.sh 15 | 16 | after_success: 17 | - bash <(curl -s https://codecov.io/bash) 18 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | VERSION := $(shell cat VERSION) 2 | 3 | proto: 4 | protoc --proto_path=./server/common/model/src/main/resources/proto --java_out=server/common/model/src/main/java server/common/model/src/main/resources/proto/*.proto # protoc-3.5.1 5 | 6 | image_build: 7 | docker build . -f docker/Dockerfile -t sofaregistry/sofaregistry:$(VERSION) 8 | 9 | image_push: 10 | docker push sofaregistry/sofaregistry:$(VERSION) 11 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policy 2 | 3 | ## Reporting a Vulnerability 4 | 5 | If you have apprehensions regarding SOFAStack's security or you discover vulnerability or potential threat, don’t hesitate to get in touch with us by dropping a mail at sofastack@antgroup.com. 6 | 7 | In the mail, specify the description of the issue or potential threat. You are also urged to recommend the way to reproduce and replicate the issue. The SOFAStack community will get back to you after assessing and analysing the findings. 8 | 9 | PLEASE PAY ATTENTION to report the security issue on the security email before disclosing it on public domain. 10 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 6.6.0 -------------------------------------------------------------------------------- /appveyor.yml: -------------------------------------------------------------------------------- 1 | # build version 2 | version: '{build}' 3 | 4 | # environment settings 5 | environment: 6 | matrix: 7 | - JAVA_HOME: C:\Program Files\Java\jdk1.8.0 8 | 9 | platform: x64 10 | 11 | # install required tools (java, maven) 12 | install: 13 | - cmd: echo %JAVA_HOME% 14 | - cmd: echo %M2_HOME% 15 | 16 | # Do not build on tags 17 | skip_tags: true 18 | 19 | # build and install artifacts 20 | build_script: 21 | - mvn clean install -DskipTests 22 | 23 | # verify artifacts 24 | test_script: 25 | - mvn test 26 | 27 | # preserve dependencies between builds 28 | cache: 29 | - C:\maven\ 30 | - C:\Users\appveyor\.m2 -------------------------------------------------------------------------------- /client/api/src/main/java/com/alipay/sofa/registry/client/api/Publisher.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.client.api; 18 | 19 | /** 20 | * The interface Publisher. 21 | * 22 | * @author zhuoyu.sjw 23 | * @version $Id : Publisher.java, v 0.1 2017-11-22 16:09 zhuoyu.sjw Exp $$ 24 | */ 25 | public interface Publisher extends Register { 26 | 27 | /** 28 | * Publish. 29 | * 30 | * @param data the data 31 | */ 32 | void republish(String... data); 33 | } 34 | -------------------------------------------------------------------------------- /client/api/src/main/java/com/alipay/sofa/registry/client/api/model/ConfigData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.client.api.model; 18 | 19 | /** 20 | * The interface Persistence data. 21 | * 22 | * @author zhuoyu.sjw 23 | * @version $Id : ConfigData.java, v 0.1 2018-04-17 17:15 zhuoyu.sjw Exp $$ 24 | */ 25 | public interface ConfigData { 26 | 27 | /** 28 | * Gets data. 29 | * 30 | * @return the data 31 | */ 32 | String getData(); 33 | } 34 | -------------------------------------------------------------------------------- /client/api/src/main/java/com/alipay/sofa/registry/client/api/model/Event.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.client.api.model; 18 | 19 | /** 20 | * The interface Event. 21 | * 22 | * @author zhuoyu.sjw 23 | * @version $Id : Event.java, v 0.1 2018-07-12 21:10 zhuoyu.sjw Exp $$ 24 | */ 25 | public interface Event {} 26 | -------------------------------------------------------------------------------- /client/api/src/main/java/com/alipay/sofa/registry/client/api/model/RegistryType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.client.api.model; 18 | 19 | /** 20 | * @author zhuoyu.sjw 21 | * @version $Id: RegistryType.java, v 0.1 2018-03-13 15:22 zhuoyu.sjw Exp $$ 22 | */ 23 | public enum RegistryType { 24 | PUBLISHER, 25 | SUBSCRIBER, 26 | CONFIGURATOR 27 | } 28 | -------------------------------------------------------------------------------- /client/api/src/test/java/com/alipay/sofa/registry/core/model/ScopeEnumTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.core.model; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | 22 | /** @author GengZhang */ 23 | public class ScopeEnumTest { 24 | 25 | @Test 26 | public void contains() { 27 | Assert.assertTrue(ScopeEnum.contains("zone")); 28 | Assert.assertFalse(ScopeEnum.contains("xxxx")); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /client/impl/src/main/java/com/alipay/sofa/registry/client/constants/VersionConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.client.constants; 18 | 19 | /** 20 | * @author zhuoyu.sjw 21 | * @version $Id: VersionConstants.java, v 0.1 2017-11-23 22:36 zhuoyu.sjw Exp $$ 22 | */ 23 | public class VersionConstants { 24 | 25 | public static final long UNINITIALIZED_VERSION = 0; 26 | } 27 | -------------------------------------------------------------------------------- /codecov.yml: -------------------------------------------------------------------------------- 1 | ignore: 2 | - '**/bootstrap/**' 3 | - '**/inegration/**' 4 | - '**/client/pb/**' 5 | - '**/MetaApplication' 6 | - '**/registry/jraft/**' 7 | - '**/DataApplication' 8 | - '**/SessionApplication' 9 | - '**/RegistryApplication' 10 | 11 | comment: 12 | behavior: default 13 | layout: reach,diff,flags,files,footer 14 | require_changes: false 15 | -------------------------------------------------------------------------------- /core/src/main/java/com/alipay/sofa/registry/core/model/ConfiguratorRegister.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.core.model; 18 | 19 | /** 20 | * @author zhuoyu.sjw 21 | * @version $Id: ConfiguratorRegister.java, v 0.1 2018-04-17 17:45 zhuoyu.sjw Exp $$ 22 | */ 23 | public class ConfiguratorRegister extends BaseRegister { 24 | private static final long serialVersionUID = 3636660681387698721L; 25 | } 26 | -------------------------------------------------------------------------------- /core/src/test/java/com/alipay/sofa/registry/core/model/RegisterResponseTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.core.model; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | 22 | public class RegisterResponseTest { 23 | @Test 24 | public void test() { 25 | RegisterResponse response = new RegisterResponse(); 26 | response.setRegistId("x1"); 27 | Assert.assertEquals(response.getRegistId(), "x1"); 28 | 29 | response.setMessage("x2"); 30 | Assert.assertEquals(response.getMessage(), "x2"); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:18.04 2 | LABEL maintainer="dzidaxie@gmail.com" 3 | 4 | RUN sed -i s/archive.ubuntu.com/mirrors.aliyun.com/g /etc/apt/sources.list \ 5 | && sed -i s/security.ubuntu.com/mirrors.aliyun.com/g /etc/apt/sources.list \ 6 | && apt-get update 7 | RUN apt-get -y install openjdk-8-jdk supervisor less net-tools vim curl iputils-ping telnet unzip 8 | 9 | COPY server/distribution/all/target/registry-all.tgz /registry-distribution/registry-all.tgz 10 | RUN tar -xzf /registry-distribution/registry-all.tgz -C /registry-distribution \ 11 | && rm -rf /registry-distribution/registry-all.tgz 12 | 13 | RUN useradd -s /bin/bash admin && usermod -a -G admin admin && mkdir -p /home/admin/logs && chown -R admin:admin /home/admin/logs && chmod -R 755 /home/admin/logs 14 | USER admin 15 | CMD ["/registry-distribution/registry-all/bin/registry-run.sh"] -------------------------------------------------------------------------------- /docker/compose/README.md: -------------------------------------------------------------------------------- 1 | # docker-compose 方式运行 sofa-registry 2 | 3 | 启动: 4 | 5 | ````shell 6 | docker-compose -f sofa-registry-in-docker-compose.yml up -d 7 | ```` 8 | 9 | 清理: 10 | 11 | ````shell 12 | docker-compose -f sofa-registry-in-docker-compose.yml down 13 | ```` 14 | 15 | 检查: 16 | 17 | ````shell 18 | # 查看meta角色的健康检测接口:(3台机器,有1台是Leader,其他2台是Follower) 19 | $ curl http://localhost:9615/health/check 20 | {"success":true,"message":"..."} 21 | 22 | # 查看data角色的健康检测接口: 23 | $ curl http://localhost:9622/health/check 24 | {"success":true,"message":"..."} 25 | 26 | # 查看session角色的健康检测接口: 27 | $ curl http://localhost:9603/health/check 28 | {"success":true,"message":"..."} 29 | ```` -------------------------------------------------------------------------------- /docker/compose/sofa-registry-in-docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.3' 2 | services: 3 | sofa-registry: 4 | image: sofaregistry/sofaregistry:6.1.4 5 | container_name: sofa-registry-integration 6 | depends_on: 7 | - sofa-mysql 8 | links: 9 | - sofa-mysql 10 | restart: always 11 | ports: 12 | - 9615:9615 13 | - 9622:9622 14 | - 9603:9603 15 | - 9600:9600 16 | environment: 17 | JDBC_URL: jdbc:mysql://sofa-mysql:3306/registrymetadb?useSSL=false&useUnicode=true&characterEncoding=utf8 18 | JDBC_USERNAME: root 19 | JDBC_PASSWORD: root 20 | REGISTRY_APP_NAME: integration 21 | networks: 22 | - sofa-registry-ns 23 | sofa-mysql: 24 | image: mysql:5.7 25 | command: --init-file /docker-entrypoint-initdb.d/init.sql --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci 26 | container_name: sofa-registry-mysql 27 | restart: always 28 | ports: 29 | - 3306:3306 30 | volumes: 31 | - ./init:/docker-entrypoint-initdb.d/ 32 | environment: 33 | MYSQL_ROOT_PASSWORD: root 34 | MYSQL_DATABASE: registrymetadb 35 | TZ: Asia/Shanghai 36 | networks: 37 | - sofa-registry-ns 38 | networks: 39 | sofa-registry-ns: 40 | driver: bridge -------------------------------------------------------------------------------- /docker/kube/mysql-deployment.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: mariadb-deployment 5 | labels: 6 | app: mariadb 7 | type: database 8 | spec: 9 | replicas: 1 10 | selector: 11 | matchLabels: 12 | app: mariadb 13 | type: database 14 | template: 15 | metadata: 16 | labels: 17 | app: mariadb 18 | type: database 19 | spec: 20 | containers: 21 | - name: mariadb 22 | image: mariadb:10.7 23 | ports: 24 | - containerPort: 3306 25 | name: db-port 26 | env: 27 | - name: MARIADB_ROOT_PASSWORD 28 | value: root 29 | volumeMounts: 30 | - name: mariadb-vol 31 | mountPath: /var/lib/mysql 32 | volumes: 33 | - name: mariadb-vol 34 | emptyDir: { } 35 | --- 36 | apiVersion: v1 37 | kind: Service 38 | metadata: 39 | name: mysql 40 | spec: 41 | selector: 42 | app: mariadb 43 | type: database 44 | ports: 45 | - protocol: TCP 46 | port: 3306 47 | targetPort: 3306 -------------------------------------------------------------------------------- /docker/kube/sofa-registry/base-integration/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: sofa-registry-config 5 | data: 6 | application.properties: | 7 | nodes.localDataCenter=DefaultDataCenter 8 | nodes.localRegion=DEFAULT_ZONE 9 | jdbc.url=jdbc:mysql://mysql.default.svc.cluster.local:3306/registrymetadb 10 | jdbc.username=root 11 | jdbc.password=root -------------------------------------------------------------------------------- /docker/kube/sofa-registry/base-integration/db-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: sofa-registry-secret 5 | type: Opaque 6 | stringData: 7 | JDBC_PASSWORD: root -------------------------------------------------------------------------------- /docker/kube/sofa-registry/base-integration/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - configmap.yaml 3 | - db-secret.yaml 4 | - integration.yaml -------------------------------------------------------------------------------- /docker/kube/sofa-registry/base-standalone/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: sofa-registry-config 5 | data: 6 | application.properties: | 7 | nodes.localDataCenter=DefaultDataCenter 8 | nodes.localRegion=DEFAULT_ZONE 9 | jdbc.url=jdbc:mysql://mysql.default.svc.cluster.local:3306/registrymetadb 10 | jdbc.username=root 11 | jdbc.password=root -------------------------------------------------------------------------------- /docker/kube/sofa-registry/base-standalone/db-secret.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: sofa-registry-secret 5 | type: Opaque 6 | stringData: 7 | JDBC_PASSWORD: root -------------------------------------------------------------------------------- /docker/kube/sofa-registry/base-standalone/kustomization.yaml: -------------------------------------------------------------------------------- 1 | resources: 2 | - configmap.yaml 3 | - db-secret.yaml 4 | - meta.yaml 5 | - data.yaml 6 | - session.yaml -------------------------------------------------------------------------------- /docker/kube/sofa-registry/overlays/integration-dc1/configmap-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: sofa-registry-config 5 | data: 6 | application.properties: | 7 | nodes.localDataCenter=DC1 8 | nodes.localRegion=DEFAULT 9 | jdbc.url=jdbc:mysql://mysql.default.svc.cluster.local:3306/registrymetadb 10 | jdbc.username=root -------------------------------------------------------------------------------- /docker/kube/sofa-registry/overlays/integration-dc1/db-secret-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: sofa-registry-secret 5 | type: Opaque 6 | stringData: 7 | JDBC_PASSWORD: root -------------------------------------------------------------------------------- /docker/kube/sofa-registry/overlays/integration-dc1/integration-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: sofa-registry-integration 5 | labels: 6 | cluster: dc1 7 | spec: 8 | replicas: 2 9 | selector: 10 | matchLabels: 11 | cluster: dc1 12 | template: 13 | metadata: 14 | labels: 15 | cluster: dc1 -------------------------------------------------------------------------------- /docker/kube/sofa-registry/overlays/integration-dc1/kustomization.yaml: -------------------------------------------------------------------------------- 1 | nameSuffix: -dc1 2 | resources: 3 | - ../../base-integration 4 | patchesStrategicMerge: 5 | - integration-patch.yaml 6 | - db-secret-patch.yaml 7 | - configmap-patch.yaml 8 | images: 9 | - name: sofaregistry/sofaregistry 10 | newTag: 6.1.4 -------------------------------------------------------------------------------- /docker/kube/sofa-registry/overlays/standalone-dc2/configmap-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | name: sofa-registry-config 5 | data: 6 | application.properties: | 7 | nodes.localDataCenter=DC2 8 | nodes.localRegion=DEFAULT 9 | jdbc.url=jdbc:mysql://mysql.default.svc.cluster.local:3306/registrymetadb 10 | jdbc.username=root -------------------------------------------------------------------------------- /docker/kube/sofa-registry/overlays/standalone-dc2/data-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: sofa-registry-data 5 | labels: 6 | cluster: dc2 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | cluster: dc2 12 | template: 13 | metadata: 14 | labels: 15 | cluster: dc2 -------------------------------------------------------------------------------- /docker/kube/sofa-registry/overlays/standalone-dc2/db-secret-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Secret 3 | metadata: 4 | name: sofa-registry-secret 5 | type: Opaque 6 | stringData: 7 | JDBC_PASSWORD: root -------------------------------------------------------------------------------- /docker/kube/sofa-registry/overlays/standalone-dc2/kustomization.yaml: -------------------------------------------------------------------------------- 1 | nameSuffix: -dc2 2 | resources: 3 | - ../../base-standalone 4 | patchesStrategicMerge: 5 | - session-patch.yaml 6 | - data-patch.yaml 7 | - meta-patch.yaml 8 | - db-secret-patch.yaml 9 | - configmap-patch.yaml 10 | images: 11 | - name: sofaregistry/sofaregistry 12 | newTag: 6.1.4 -------------------------------------------------------------------------------- /docker/kube/sofa-registry/overlays/standalone-dc2/meta-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: sofa-registry-meta 5 | labels: 6 | cluster: dc2 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | cluster: dc2 12 | template: 13 | metadata: 14 | labels: 15 | cluster: dc2 -------------------------------------------------------------------------------- /docker/kube/sofa-registry/overlays/standalone-dc2/session-patch.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | name: sofa-registry-session 5 | labels: 6 | cluster: dc2 7 | spec: 8 | replicas: 1 9 | selector: 10 | matchLabels: 11 | cluster: dc2 12 | template: 13 | metadata: 14 | labels: 15 | cluster: dc2 -------------------------------------------------------------------------------- /ruleset.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | My custom rules 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 2 27 | 28 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/ElementType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model; 18 | 19 | /** 20 | * @author shangyu.wh 21 | * @version $Id: ElementType.java, v 0.1 2018-08-17 16:22 shangyu.wh Exp $ 22 | */ 23 | public enum ElementType { 24 | 25 | /** sub zone scope,@see DefaultSubscriber */ 26 | SUBSCRIBER, 27 | /** multiple zone sub,@see DefaultSubscriberMulti */ 28 | MULTISUBSCRIBER, 29 | /** */ 30 | PUBLISHER 31 | } 32 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/PublishSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model; 18 | 19 | public enum PublishSource { 20 | CLIENT, 21 | DATUM_SYNCER, 22 | } 23 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/PublishType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model; 18 | 19 | /** 20 | * @author shangyu.wh 21 | * @version $Id: PublishType.java, v 0.1 2018-08-29 17:11 shangyu.wh Exp $ 22 | */ 23 | public enum PublishType { 24 | 25 | /** normally publisher */ 26 | NORMAL, 27 | /** TEMPORARY publisher */ 28 | TEMPORARY 29 | } 30 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/client/pb/DataBoxPbOrBuilder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model.client.pb; 18 | 19 | public interface DataBoxPbOrBuilder 20 | extends 21 | // @@protoc_insertion_point(interface_extends:DataBoxPb) 22 | com.google.protobuf.MessageOrBuilder { 23 | 24 | /** string data = 1; */ 25 | java.lang.String getData(); 26 | /** string data = 1; */ 27 | com.google.protobuf.ByteString getDataBytes(); 28 | } 29 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/metaserver/DataOperation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model.metaserver; 18 | 19 | /** 20 | * @author shangyu.wh 21 | * @version $Id: DataOperator.java, v 0.1 2018-04-17 21:03 shangyu.wh Exp $ 22 | */ 23 | public enum DataOperation { 24 | ADD, 25 | REMOVE, 26 | UPDATE, 27 | QUERY 28 | } 29 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/metaserver/cleaner/AppRevisionSliceRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model.metaserver.cleaner; 18 | 19 | public class AppRevisionSliceRequest extends BaseSliceRequest { 20 | 21 | public AppRevisionSliceRequest(int slotNum, int slotId) { 22 | super(slotNum, slotId); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/sessionserver/ClientManagerQueryRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model.sessionserver; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * @author xiaojian.xj 23 | * @version : ClientManagerQueryRequest.java, v 0.1 2021年07月31日 15:52 xiaojian.xj Exp $ 24 | */ 25 | public class ClientManagerQueryRequest implements Serializable {} 26 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/sessionserver/GrayOpenPushSwitchRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model.sessionserver; 18 | 19 | import com.google.common.collect.Lists; 20 | import java.util.List; 21 | 22 | public class GrayOpenPushSwitchRequest { 23 | private List ips = Lists.newArrayList(); 24 | 25 | public List getIps() { 26 | return ips; 27 | } 28 | 29 | public void setIps(List ips) { 30 | this.ips = ips; 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/slot/GetSlotTableStatusRequest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model.slot; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * @author xiaojian.xj 23 | * @version $Id: GetSlotTableStatusRequest.java, v 0.1 2021年07月02日 8:07 PM xiaojian.xj Exp $ 24 | */ 25 | public class GetSlotTableStatusRequest implements Serializable { 26 | 27 | private static final long serialVersionUID = 3343855660232710818L; 28 | } 29 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/slot/filter/SyncSlotAcceptAllManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model.slot.filter; 18 | 19 | /** 20 | * @author xiaojian.xj 21 | * @version : SyncSlotAcceptAllManager.java, v 0.1 2022年07月20日 20:06 xiaojian.xj Exp $ 22 | */ 23 | public class SyncSlotAcceptAllManager implements SyncSlotAcceptorManager { 24 | 25 | @Override 26 | public boolean accept(SyncAcceptorRequest request) { 27 | return true; 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/slot/filter/SyncSlotAcceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model.slot.filter; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * @author xiaojian.xj 23 | * @version : SyncSlotAcceptor.java, v 0.1 2022年05月13日 19:51 xiaojian.xj Exp $ 24 | */ 25 | public interface SyncSlotAcceptor extends Serializable { 26 | 27 | boolean accept(SyncAcceptorRequest request); 28 | 29 | boolean filterOut(SyncAcceptorRequest request); 30 | 31 | String name(); 32 | } 33 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/slot/filter/SyncSlotAcceptorManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model.slot.filter; 18 | 19 | import java.io.Serializable; 20 | 21 | /** 22 | * @author xiaojian.xj 23 | * @version : SyncSlotAcceptorManager.java, v 0.1 2022年05月24日 21:39 xiaojian.xj Exp $ 24 | */ 25 | public interface SyncSlotAcceptorManager extends Serializable { 26 | 27 | boolean accept(SyncAcceptorRequest request); 28 | } 29 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/slot/func/HashFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model.slot.func; 18 | 19 | /** 20 | * Hash Function 21 | * 22 | * @author zhuoyu.sjw 23 | * @version $Id: HashFunction.java, v 0.1 2016-11-01 15:19 zhuoyu.sjw Exp $$ 24 | */ 25 | public interface HashFunction { 26 | 27 | /** 28 | * return object's int hashCode 29 | * 30 | * @param o object 31 | * @return int hashCode 32 | */ 33 | int hash(Object o); 34 | } 35 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/slot/func/SlotFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model.slot.func; 18 | 19 | /** 20 | * @author yuzhi.lyz 21 | * @version v 0.1 2020-11-02 15:35 yuzhi.lyz Exp $ 22 | */ 23 | public interface SlotFunction { 24 | String name(); 25 | 26 | int maxSlots(); 27 | 28 | int slotOf(Object o); 29 | } 30 | -------------------------------------------------------------------------------- /server/common/model/src/main/java/com/alipay/sofa/registry/common/model/wrapper/Wrapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.common.model.wrapper; 18 | 19 | import java.util.function.Supplier; 20 | 21 | /** 22 | * @author shangyu.wh 23 | * @version 1.0: Wrapper.java, v 0.1 2019-06-18 19:33 shangyu.wh Exp $ 24 | */ 25 | public interface Wrapper { 26 | 27 | R call(); 28 | 29 | Supplier getParameterSupplier(); 30 | } 31 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/AppDiscoveryMetaPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "proto"; 5 | 6 | 7 | message MetaRegister { 8 | string application = 1; 9 | string revision = 2; 10 | string clientVersion = 3; 11 | map baseParams = 4; 12 | map services = 5; 13 | } 14 | 15 | message MetaService{ 16 | string id = 1; 17 | map params = 3; 18 | } 19 | 20 | message StringList{ 21 | repeated string values = 1; 22 | } 23 | 24 | message AppList { 25 | int64 version = 1; 26 | repeated string apps = 2; 27 | } 28 | 29 | message ServiceAppMappingRequest{ 30 | repeated string serviceIds = 1; 31 | } 32 | 33 | message ServiceAppMappingResponse{ 34 | map serviceAppMapping = 1; 35 | int32 statusCode = 2; 36 | string message = 3; 37 | } 38 | 39 | message GetRevisionsRequest{ 40 | repeated string revisions = 1; 41 | } 42 | 43 | message GetRevisionsResponse{ 44 | map revisions = 1; 45 | int32 statusCode = 2; 46 | string message = 3; 47 | } 48 | 49 | message MetaHeartbeatRequest{ 50 | repeated string revisions = 1; 51 | } 52 | 53 | message MetaHeartbeatResponse{ 54 | int32 statusCode = 1; 55 | string message = 2; 56 | } -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/BaseRegisterPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "pb"; 5 | 6 | message BaseRegisterPb { 7 | string instanceId = 1; 8 | string zone = 2; 9 | string appName = 3; 10 | string dataId = 4; 11 | string group = 5; 12 | string processId = 6; 13 | string registId = 7; 14 | string clientId = 8; 15 | string dataInfoId = 9; 16 | string ip = 10; 17 | int32 port = 11; 18 | string eventType = 12; 19 | int64 version = 13; 20 | int64 timestamp = 14; 21 | map attributes = 15; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/DataBoxPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "pb"; 5 | 6 | message DataBoxPb { 7 | string data = 1; 8 | } 9 | 10 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/DataBoxesPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "pb"; 5 | 6 | import "DataBoxPb.proto"; 7 | 8 | message DataBoxesPb { 9 | repeated DataBoxPb data = 1; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/EventTypePb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "pb"; 5 | 6 | enum EventTypePb { 7 | REGISTER = 0; 8 | UNREGISTER = 1; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/MultiReceivedDataPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "proto"; 5 | 6 | import "MultiSegmentDataPb.proto"; 7 | 8 | message MultiReceivedDataPb { 9 | string dataId = 1; 10 | string group = 2; 11 | string instanceId = 3; 12 | string scope = 4; 13 | repeated string subscriberRegistIds = 5; 14 | 15 | string localSegment = 6; 16 | string localZone = 7; 17 | 18 | map multiData = 8; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/MultiSegmentDataPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "proto"; 5 | 6 | import "DataBoxesPb.proto"; 7 | 8 | message MultiSegmentDataPb { 9 | 10 | string segment = 1; 11 | bytes zipData = 2; 12 | map unzipData = 3; 13 | string encoding = 4; 14 | int64 version = 5; 15 | map pushDataCount = 6; 16 | } 17 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/PublisherRegisterPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "pb"; 5 | 6 | import "DataBoxPb.proto"; 7 | import "BaseRegisterPb.proto"; 8 | 9 | message PublisherRegisterPb { 10 | repeated DataBoxPb dataList = 1; 11 | 12 | BaseRegisterPb baseRegister = 2; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/ReceivedConfigDataPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "pb"; 5 | 6 | import "DataBoxPb.proto"; 7 | 8 | message ReceivedConfigDataPb { 9 | string dataId = 1; 10 | string group = 2; 11 | string instanceId = 3; 12 | repeated string configuratorRegistIds = 4; 13 | DataBoxPb dataBox = 5; 14 | int64 version = 6; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/ReceivedDataBodyPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "proto"; 5 | 6 | import "DataBoxesPb.proto"; 7 | 8 | message ReceivedDataBodyPb{ 9 | map data = 7; 10 | 11 | } -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/ReceivedDataPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "proto"; 5 | 6 | import "DataBoxesPb.proto"; 7 | 8 | message ReceivedDataPb { 9 | string dataId = 1; 10 | string group = 2; 11 | string instanceId = 3; 12 | string segment = 4; 13 | string scope = 5; 14 | repeated string subscriberRegistIds = 6; 15 | map data = 7; 16 | int64 version = 8; 17 | string localZone = 9; 18 | 19 | string encoding = 10; 20 | bytes body = 11; 21 | int32 originBodySize = 12; 22 | 23 | map pushDataCount = 13; 24 | 25 | } 26 | 27 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/RegisterResponsePb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "pb"; 5 | 6 | message RegisterResponsePb { 7 | bool success = 1; 8 | string registId = 2; 9 | int64 version = 3; 10 | bool refused = 4; 11 | string message = 5; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/ResultPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "pb"; 5 | 6 | message ResultPb { 7 | bool success = 1; 8 | string message = 2; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/ScopeEnumPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "pb"; 5 | 6 | enum ScopeEnumPb { 7 | zone = 0; 8 | dataCenter = 1; 9 | global = 2; 10 | } 11 | 12 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/SubscriberRegisterPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "proto"; 5 | 6 | import "BaseRegisterPb.proto"; 7 | 8 | message SubscriberRegisterPb { 9 | string scope = 1; 10 | BaseRegisterPb baseRegister = 2; 11 | string acceptEncoding = 3; 12 | bool acceptMulti = 4; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/SyncConfigRequestPb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "pb"; 5 | 6 | message SyncConfigRequestPb { 7 | string dataCenter = 1; 8 | string zone = 2; 9 | } 10 | 11 | -------------------------------------------------------------------------------- /server/common/model/src/main/resources/proto/SyncConfigResponsePb.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | option java_package = "com.alipay.sofa.registry.common.model.client.pb"; 3 | option java_multiple_files = true; 4 | option go_package = "pb"; 5 | 6 | import "ResultPb.proto"; 7 | 8 | message SyncConfigResponsePb { 9 | ResultPb result = 1; 10 | repeated string availableSegments = 2; 11 | int32 retryInterval = 3; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /server/common/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | com.alipay.sofa 7 | registry-server-parent 8 | 6.6.0 9 | ../pom.xml 10 | 11 | 4.0.0 12 | 13 | registry-common 14 | pom 15 | 16 | 17 | ../../ 18 | 19 | 20 | 21 | model 22 | util 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/cache/Sizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.cache; 18 | 19 | public interface Sizer { 20 | int size(); 21 | } 22 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/compress/CompressConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.compress; 18 | 19 | public class CompressConstants { 20 | public static final String encodingGzip = "gzip"; 21 | public static final String encodingZstd = "zstd"; 22 | public static final int defaultCompressPushMinSize = 1024 * 4; // 4KB 23 | public static final int defaultCompressDatumMinSize = 1024 * 12; // 12KB 24 | 25 | public static final String[] defaultCompressEncodes = new String[] {encodingZstd}; 26 | } 27 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/compress/CompressKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.compress; 18 | 19 | import com.alipay.sofa.registry.cache.Sizer; 20 | 21 | public interface CompressKey extends Sizer {} 22 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/concurrent/UnThrowableCallable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.concurrent; 18 | 19 | public interface UnThrowableCallable { 20 | V call(); 21 | } 22 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/datacenter/DataCenterAware.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.datacenter; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Nov 19, 2020 22 | */ 23 | public interface DataCenterAware { 24 | String getDc(); 25 | } 26 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/exception/MetaLeaderQueryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.exception; 18 | 19 | /** 20 | * @author xiaojian.xj 21 | * @version $Id: MetaLeaderQueryException.java, v 0.1 2021年03月22日 14:30 xiaojian.xj Exp $ 22 | */ 23 | public class MetaLeaderQueryException extends SofaRegistryRuntimeException { 24 | public MetaLeaderQueryException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/exception/SofaRegistrySlotTableException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.exception; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Jan 26, 2021 22 | */ 23 | public class SofaRegistrySlotTableException extends SofaRegistryRuntimeException { 24 | public SofaRegistrySlotTableException(String message) { 25 | super(message); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/exception/StartException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.exception; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Nov 13, 2020 22 | */ 23 | public class StartException extends SofaRegistryRuntimeException { 24 | 25 | public StartException(String message) { 26 | super(message); 27 | } 28 | 29 | public StartException(String message, Throwable th) { 30 | super(message, th); 31 | } 32 | 33 | public StartException(Throwable th) { 34 | super(th); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/exception/StopException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.exception; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Nov 13, 2020 22 | */ 23 | public class StopException extends SofaRegistryRuntimeException { 24 | public StopException(String message) { 25 | super(message); 26 | } 27 | 28 | public StopException(String message, Throwable th) { 29 | super(message, th); 30 | } 31 | 32 | public StopException(Throwable th) { 33 | super(th); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/exception/UnSupportOperationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.exception; 18 | 19 | /** 20 | * @author xiaojian.xj 21 | * @version : UnSupportOperationException.java, v 0.1 2022年05月12日 20:57 xiaojian.xj Exp $ 22 | */ 23 | public class UnSupportOperationException extends SofaRegistryRuntimeException { 24 | 25 | public UnSupportOperationException(String operation) { 26 | super("not support operation: " + operation); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/lifecycle/Disposable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.lifecycle; 18 | 19 | import com.alipay.sofa.registry.exception.DisposeException; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Nov 13, 2020 24 | */ 25 | public interface Disposable { 26 | 27 | void dispose() throws DisposeException; 28 | } 29 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/lifecycle/Initializable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.lifecycle; 18 | 19 | import com.alipay.sofa.registry.exception.InitializeException; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Nov 13, 2020 24 | */ 25 | public interface Initializable { 26 | 27 | void initialize() throws InitializeException; 28 | } 29 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/lifecycle/Lifecycle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.lifecycle; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Nov 13, 2020 22 | */ 23 | public interface Lifecycle 24 | extends Initializable, Startable, Stoppable, Disposable, LifecycleStateAware {} 25 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/lifecycle/LifecycleController.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.lifecycle; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Nov 13, 2020 22 | */ 23 | public interface LifecycleController { 24 | 25 | boolean canInitialize(LifecycleState.LifecyclePhase phase); 26 | 27 | boolean canStart(LifecycleState.LifecyclePhase phase); 28 | 29 | boolean canStop(LifecycleState.LifecyclePhase phase); 30 | 31 | boolean canDispose(LifecycleState.LifecyclePhase phase); 32 | } 33 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/lifecycle/LifecycleStateAware.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.lifecycle; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Nov 13, 2020 22 | */ 23 | public interface LifecycleStateAware { 24 | 25 | LifecycleState getLifecycleState(); 26 | } 27 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/lifecycle/LiteLifecycle.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.lifecycle; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Nov 20, 2020 22 | */ 23 | public interface LiteLifecycle extends Startable, Stoppable {} 24 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/lifecycle/Startable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.lifecycle; 18 | 19 | import com.alipay.sofa.registry.exception.StartException; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Nov 13, 2020 24 | */ 25 | public interface Startable { 26 | 27 | void start() throws StartException; 28 | } 29 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/lifecycle/Stoppable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.lifecycle; 18 | 19 | import com.alipay.sofa.registry.exception.StopException; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Nov 13, 2020 24 | */ 25 | public interface Stoppable { 26 | 27 | void stop() throws StopException; 28 | } 29 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/lifecycle/Suspendable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.lifecycle; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Mar 08, 2021 22 | */ 23 | public interface Suspendable { 24 | 25 | void suspend(); 26 | 27 | void resume(); 28 | 29 | boolean isSuspended(); 30 | } 31 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/observer/Observable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.observer; 18 | 19 | /** @author zhuchen */ 20 | public interface Observable { 21 | 22 | void addObserver(UnblockingObserver observer); 23 | 24 | void removeObserver(UnblockingObserver observer); 25 | } 26 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/observer/UnblockingObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.observer; 18 | 19 | /** @author zhuchen */ 20 | public interface UnblockingObserver { 21 | 22 | void update(Observable source, Object message); 23 | } 24 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/task/FastRejectedExecutionException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.task; 18 | 19 | import java.util.concurrent.RejectedExecutionException; 20 | 21 | public class FastRejectedExecutionException extends RejectedExecutionException { 22 | public FastRejectedExecutionException(String message) { 23 | super(message); 24 | } 25 | 26 | @Override 27 | public Throwable fillInStackTrace() { 28 | // not fill the stack trace 29 | return this; 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/task/TaskErrorSilenceException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.task; 18 | 19 | public class TaskErrorSilenceException extends RuntimeException { 20 | public static final TaskErrorSilenceException INSTANCE = new TaskErrorSilenceException(); 21 | } 22 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/util/ObjectFactory.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.util; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Nov 23, 2020 22 | */ 23 | public interface ObjectFactory { 24 | V create(); 25 | } 26 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/util/StringFormatter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.util; 18 | 19 | import org.slf4j.helpers.FormattingTuple; 20 | import org.slf4j.helpers.MessageFormatter; 21 | 22 | public final class StringFormatter { 23 | private StringFormatter() {} 24 | 25 | public static String format(String messagePattern, Object... argArray) { 26 | FormattingTuple tuple = MessageFormatter.arrayFormat(messagePattern, argArray); 27 | return tuple.getMessage(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /server/common/util/src/main/java/com/alipay/sofa/registry/util/StringUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.util; 18 | 19 | public class StringUtils { 20 | public static int sizeof(String s) { 21 | if (s == null) { 22 | return 0; 23 | } 24 | return s.length() * 2; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /server/common/util/src/test/java/com/alipay/sofa/registry/TestScheduler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Nov 30, 2020 22 | */ 23 | public class TestScheduler {} 24 | -------------------------------------------------------------------------------- /server/common/util/src/test/java/com/alipay/sofa/registry/hacktest/HackWrapperTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.hacktest; 18 | 19 | import org.apache.logging.log4j.core.async.HackTest; 20 | import org.junit.Test; 21 | 22 | public class HackWrapperTest { 23 | @Test 24 | public void test() throws Exception { 25 | HackTest hack = new HackTest(); 26 | hack.testSLF4jLogger(); 27 | hack.test(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /server/common/util/src/test/java/com/alipay/sofa/registry/trace/TraceIDTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.trace; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | 22 | public class TraceIDTest { 23 | @Test 24 | public void test() { 25 | TraceID id = TraceID.newTraceID(); 26 | for (int i = 0; i < 100; i++) { 27 | TraceID other = TraceID.newTraceID(); 28 | Assert.assertNotEquals(id.toString(), other.toString()); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /server/common/util/src/test/java/com/alipay/sofa/registry/util/AtomicSetTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.util; 18 | 19 | import org.junit.Assert; 20 | import org.junit.Test; 21 | 22 | public class AtomicSetTest { 23 | 24 | @Test 25 | public void test() { 26 | AtomicSet set = new AtomicSet<>(); 27 | set.add("1234"); 28 | set.add("1234"); 29 | Assert.assertEquals(1, set.getAndReset().size()); 30 | Assert.assertEquals(0, set.getAndReset().size()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /server/common/util/src/test/java/com/alipay/sofa/registry/util/MathUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.util; 18 | 19 | import static org.junit.Assert.*; 20 | 21 | import org.junit.Assert; 22 | import org.junit.Test; 23 | 24 | public class MathUtilsTest { 25 | 26 | @Test 27 | public void testDivideCeil() { 28 | Assert.assertEquals(3, MathUtils.divideCeil(5, 2)); 29 | Assert.assertEquals(3, MathUtils.divideCeil(6, 2)); 30 | Assert.assertEquals(4, MathUtils.divideCeil(7, 2)); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /server/common/util/src/test/java/com/alipay/sofa/registry/util/OsUtilsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.util; 18 | 19 | import static org.junit.Assert.*; 20 | 21 | import com.alipay.sofa.registry.log.Logger; 22 | import com.alipay.sofa.registry.log.LoggerFactory; 23 | import org.junit.Test; 24 | 25 | public class OsUtilsTest { 26 | 27 | private Logger logger = LoggerFactory.getLogger(OsUtilsTest.class); 28 | 29 | @Test 30 | public void getCpuCount() { 31 | logger.info("cpu cores: {}", OsUtils.getCpuCount()); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /server/distribution/all/bin/base/shutdown_base.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o pipefail 4 | 5 | if [[ -z "$REGISTRY_APP_NAME" ]]; then 6 | echo "Must provide REGISTRY_APP_NAME in environment" 1>&2 7 | exit 1 8 | fi 9 | echo "killing registry-${REGISTRY_APP_NAME} server..." 10 | pids=`ps aux | grep java | grep registry-${REGISTRY_APP_NAME} | awk '{print $2;}'` 11 | for pid in "${pids[@]}" 12 | do 13 | if [ -z "$pid" ]; then 14 | continue; 15 | fi 16 | kill $pid 17 | done 18 | echo "Done!" -------------------------------------------------------------------------------- /server/distribution/all/bin/data/shutdown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASE_DIR=`cd $(dirname $0)/../..; pwd` 4 | REGISTRY_APP_NAME=data ${BASE_DIR}/bin/base/shutdown_base.sh -------------------------------------------------------------------------------- /server/distribution/all/bin/data/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASE_DIR=`cd $(dirname $0)/../..; pwd` 4 | REGISTRY_APP_NAME=data exec ${BASE_DIR}/bin/base/start_base.sh -------------------------------------------------------------------------------- /server/distribution/all/bin/integration/shutdown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASE_DIR=`cd $(dirname $0)/../..; pwd` 4 | REGISTRY_APP_NAME=integration ${BASE_DIR}/bin/base/shutdown_base.sh -------------------------------------------------------------------------------- /server/distribution/all/bin/integration/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASE_DIR=`cd $(dirname $0)/../..; pwd` 4 | export SPRING_PROFILES_ACTIVE="prod" 5 | REGISTRY_APP_NAME=integration exec ${BASE_DIR}/bin/base/start_base.sh -------------------------------------------------------------------------------- /server/distribution/all/bin/integration/start_dev.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASE_DIR=`cd $(dirname $0)/../..; pwd` 4 | export SPRING_PROFILES_ACTIVE="dev" 5 | REGISTRY_APP_NAME=integration exec ${BASE_DIR}/bin/base/start_base.sh -------------------------------------------------------------------------------- /server/distribution/all/bin/meta/shutdown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASE_DIR=`cd $(dirname $0)/../..; pwd` 4 | REGISTRY_APP_NAME=meta ${BASE_DIR}/bin/base/shutdown_base.sh 5 | -------------------------------------------------------------------------------- /server/distribution/all/bin/meta/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASE_DIR=`cd $(dirname $0)/../..; pwd` 4 | REGISTRY_APP_NAME=meta exec ${BASE_DIR}/bin/base/start_base.sh -------------------------------------------------------------------------------- /server/distribution/all/bin/registry-run.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -o pipefail 4 | 5 | if [[ -z "$REGISTRY_APP_NAME" ]]; then 6 | echo "Must provide REGISTRY_APP_NAME in environment" 1>&2 7 | exit 1 8 | fi 9 | 10 | BASE_DIR=/registry-distribution/registry-all 11 | if [ ${REGISTRY_APP_NAME} == "meta" ];then 12 | exec ${BASE_DIR}/bin/meta/start.sh 13 | elif [ ${REGISTRY_APP_NAME} == "data" ];then 14 | exec ${BASE_DIR}/bin/data/start.sh 15 | elif [ ${REGISTRY_APP_NAME} == "session" ];then 16 | exec ${BASE_DIR}/bin/session/start.sh 17 | elif [ ${REGISTRY_APP_NAME} == "integration" ];then 18 | exec ${BASE_DIR}/bin/integration/start.sh 19 | else 20 | echo "REGISTRY_APP_NAME ${REGISTRY_APP_NAME} unexpected" 1>&2 21 | exit 1 22 | fi -------------------------------------------------------------------------------- /server/distribution/all/bin/session/shutdown.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASE_DIR=`cd $(dirname $0)/../..; pwd` 4 | REGISTRY_APP_NAME=session ${BASE_DIR}/bin/base/shutdown_base.sh 5 | -------------------------------------------------------------------------------- /server/distribution/all/bin/session/start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BASE_DIR=`cd $(dirname $0)/../..; pwd` 4 | REGISTRY_APP_NAME=session exec ${BASE_DIR}/bin/base/start_base.sh -------------------------------------------------------------------------------- /server/distribution/all/conf/application-dev.properties: -------------------------------------------------------------------------------- 1 | #nodes.localDataCenter=DefaultDataCenter 2 | #nodes.localRegion=DEFAULT_ZONE 3 | ## connect db 4 | jdbc.driverClassName=org.h2.Driver 5 | jdbc.url=jdbc:h2:mem:metadatadb;DB_CLOSE_DELAY=-1;MODE=MySQL;MV_STORE=FALSE 6 | jdbc.mapperLocations=classpath:h2-mapper/*.xml 7 | jdbc.username=sa 8 | jdbc.password= 9 | -------------------------------------------------------------------------------- /server/distribution/all/conf/application.properties: -------------------------------------------------------------------------------- 1 | #nodes.localDataCenter=DefaultDataCenter 2 | #nodes.localRegion=DEFAULT_ZONE 3 | ## connect db 4 | #jdbc.driverClassName=com.mysql.jdbc.Driver 5 | jdbc.url=jdbc:mysql://127.0.0.1:3306/registrymetadb 6 | jdbc.username=root 7 | jdbc.password=root 8 | -------------------------------------------------------------------------------- /server/distribution/all/conf/supervisord/registry.supervisord.conf: -------------------------------------------------------------------------------- 1 | [program:registry] 2 | command=/registry-distribution/registry-all/bin/registry-run.sh 3 | user=admin 4 | environment=HOME="/home/admin",USER="admin" 5 | startsecs=30 6 | autostart = true 7 | autorestart=true 8 | stopwaitsecs=10 9 | stopasgroup=true -------------------------------------------------------------------------------- /server/remoting/api/src/main/java/com/alipay/sofa/registry/remoting/ChannelConnectException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.remoting; 18 | 19 | public class ChannelConnectException extends RuntimeException { 20 | public ChannelConnectException(String message) { 21 | super(message); 22 | } 23 | 24 | public ChannelConnectException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /server/remoting/api/src/main/java/com/alipay/sofa/registry/remoting/ChannelOverflowException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.remoting; 18 | 19 | public class ChannelOverflowException extends RuntimeException { 20 | 21 | public ChannelOverflowException(String message, Throwable cause) { 22 | super(message, cause); 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /server/remoting/api/src/main/java/com/alipay/sofa/registry/remoting/RemotingException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.remoting; 18 | 19 | /** 20 | * @author shangyu.wh 21 | * @version $Id: RemotingException.java, v 0.1 2017-11-20 20:43 shangyu.wh Exp $ 22 | */ 23 | public class RemotingException extends RuntimeException { 24 | 25 | /** 26 | * constructor 27 | * 28 | * @param s 29 | */ 30 | public RemotingException(String s) { 31 | super(s); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /server/remoting/api/src/main/java/com/alipay/sofa/registry/remoting/exchange/ExchangeCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.remoting.exchange; 18 | 19 | import com.alipay.sofa.registry.remoting.Channel; 20 | 21 | public interface ExchangeCallback { 22 | // callback channel maybe is null 23 | void onCallback(Channel channel, T message); 24 | 25 | // callback channel maybe is null 26 | void onException(Channel channel, Throwable exception); 27 | } 28 | -------------------------------------------------------------------------------- /server/remoting/api/src/main/java/com/alipay/sofa/registry/remoting/exchange/RequestChannelClosedException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.remoting.exchange; 18 | 19 | import com.alipay.sofa.registry.remoting.exchange.message.Request; 20 | 21 | public class RequestChannelClosedException extends RequestException { 22 | public RequestChannelClosedException(String message, Request request) { 23 | super(message, request); 24 | } 25 | 26 | public RequestChannelClosedException(String message) { 27 | super(message); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /server/remoting/api/src/main/java/com/alipay/sofa/registry/remoting/exchange/message/Response.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.remoting.exchange.message; 18 | 19 | /** 20 | * @author shangyu.wh 21 | * @version $Id: Response.java, v 0.1 2017-11-30 17:39 shangyu.wh Exp $ 22 | */ 23 | public interface Response { 24 | 25 | /** The enum for response status */ 26 | enum ResultStatus { 27 | SUCCESSFUL, 28 | FAILED 29 | } 30 | 31 | /** 32 | * Get response result 33 | * 34 | * @return 35 | */ 36 | T getResult(); 37 | } 38 | -------------------------------------------------------------------------------- /server/remoting/http/src/test/java/com/alipay/sofa/registry/remoting/jersey/TestHttpResource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.remoting.jersey; 18 | 19 | import javax.ws.rs.GET; 20 | import javax.ws.rs.Path; 21 | import javax.ws.rs.Produces; 22 | import javax.ws.rs.core.MediaType; 23 | 24 | /** 25 | * @author xuanbei 26 | * @since 2019/3/27 27 | */ 28 | @Path("test") 29 | public class TestHttpResource { 30 | @GET 31 | @Produces(MediaType.APPLICATION_JSON) 32 | public String test() { 33 | return "TestResource"; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /server/remoting/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | com.alipay.sofa 7 | registry-server-parent 8 | 6.6.0 9 | ../pom.xml 10 | 11 | 4.0.0 12 | pom 13 | 14 | 15 | ../../ 16 | 17 | 18 | 19 | api 20 | bolt 21 | http 22 | 23 | 24 | registry-remoting 25 | 26 | -------------------------------------------------------------------------------- /server/server/data/src/main/java/com/alipay/sofa/registry/server/data/cache/CleanContinues.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.data.cache; 18 | 19 | public interface CleanContinues { 20 | CleanContinues ALWAYS = 21 | new CleanContinues() { 22 | @Override 23 | public boolean continues() { 24 | return true; 25 | } 26 | 27 | @Override 28 | public void onClean(int num) {} 29 | }; 30 | 31 | boolean continues(); 32 | 33 | void onClean(int num); 34 | } 35 | -------------------------------------------------------------------------------- /server/server/data/src/main/java/com/alipay/sofa/registry/server/data/change/DataChangeType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.data.change; 18 | 19 | public enum DataChangeType { 20 | UNKNOWN, 21 | PUT, 22 | SYNC, 23 | MIGRATED, 24 | LEASE, 25 | SYNC_REMOTE, 26 | CLEAR 27 | } 28 | -------------------------------------------------------------------------------- /server/server/data/src/main/java/com/alipay/sofa/registry/server/data/slot/SlotChangeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.data.slot; 18 | 19 | import com.alipay.sofa.registry.common.model.slot.Slot; 20 | 21 | /** 22 | * @author yuzhi.lyz 23 | * @version v 0.1 2020-10-30 10:46 yuzhi.lyz Exp $ 24 | */ 25 | public interface SlotChangeListener { 26 | void onSlotAdd(String dataCenter, int slotId, Slot.Role role); 27 | 28 | void onSlotRemove(String dataCenter, int slotId, Slot.Role role); 29 | } 30 | -------------------------------------------------------------------------------- /server/server/data/src/main/java/com/alipay/sofa/registry/server/data/slot/SyncContinues.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.data.slot; 18 | 19 | public interface SyncContinues { 20 | boolean continues(); 21 | } 22 | -------------------------------------------------------------------------------- /server/server/data/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | nodes.localDataCenter=DefaultDataCenter 2 | nodes.localRegion=DEFAULT_ZONE 3 | nodes.localSegmentRegions=DEFAULT_ZONE 4 | ## connect db 5 | jdbc.driverClassName=com.mysql.jdbc.Driver 6 | jdbc.url=jdbc:mysql://127.0.0.1:3306/registrymetadb?useUnicode=true&characterEncoding=utf8 7 | jdbc.username=root 8 | jdbc.password=root 9 | data.server.gracefulShutdown=true 10 | -------------------------------------------------------------------------------- /server/server/data/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | ____ _ ____ 3 | | _ \ __ _| |_ __ _ / ___| ___ _ ____ _____ _ __ 4 | | | | |/ _` | __/ _` | \___ \ / _ \ '__\ \ / / _ \ '__| 5 | | |_| | (_| | || (_| | ___) | __/ | \ V / __/ | 6 | |____/ \__,_|\__\__,_| |____/ \___|_| \_/ \___|_| 7 | -------------------------------------------------------------------------------- /server/server/integration/src/main/resources/application-dev.properties: -------------------------------------------------------------------------------- 1 | nodes.localDataCenter=DefaultDataCenter 2 | #nodes.metaNode=DefaultDataCenter:localhost 3 | nodes.localRegion=DEFAULT_ZONE 4 | nodes.localSegmentRegions=DEFAULT_ZONE 5 | ## connect db 6 | #persistence.profile.active=jdbc 7 | jdbc.driverClassName=org.h2.Driver 8 | jdbc.url=jdbc:h2:mem:metadatadb;DB_CLOSE_DELAY=-1;MODE=MySQL;MV_STORE=FALSE 9 | jdbc.mapperLocations=classpath:h2-mapper/*.xml 10 | jdbc.username=sa 11 | jdbc.password= 12 | session.server.gracefulShutdown=false 13 | data.server.gracefulShutdown=false 14 | 15 | -------------------------------------------------------------------------------- /server/server/integration/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | nodes.localDataCenter=DefaultDataCenter 2 | #nodes.metaNode=DefaultDataCenter:localhost 3 | nodes.localRegion=DEFAULT_ZONE 4 | nodes.localSegmentRegions=DEFAULT_ZONE 5 | ## connect db 6 | jdbc.driverClassName=com.mysql.jdbc.Driver 7 | jdbc.url=jdbc:mysql://127.0.0.1:3306/registrymetadb?useUnicode=true&characterEncoding=utf8 8 | jdbc.username=root 9 | jdbc.password=root 10 | -------------------------------------------------------------------------------- /server/server/integration/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | ______ _ _ _____ 3 | | ___ \ (_) | | / ___| 4 | | |_/ /___ __ _ _ ___| |_ _ __ _ _ \ `--. ___ _ ____ _____ _ __ 5 | | // _ \/ _` | / __| __| '__| | | | `--. \/ _ \ '__\ \ / / _ \ '__| 6 | | |\ \ __/ (_| | \__ \ |_| | | |_| | /\__/ / __/ | \ V / __/ | 7 | \_| \_\___|\__, |_|___/\__|_| \__, | \____/ \___|_| \_/ \___|_| 8 | __/ | __/ | 9 | |___/ |___/ 10 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/MetaServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta; 18 | 19 | import com.alipay.sofa.registry.lifecycle.Lifecycle; 20 | import com.alipay.sofa.registry.server.meta.slot.SlotTableAware; 21 | 22 | /** 23 | * @author chen.zhu 24 | *

Nov 13, 2020 25 | */ 26 | public interface MetaServer extends SlotTableAware, Lifecycle {} 27 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/cluster/RemoteServer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.cluster; 18 | 19 | import com.alipay.sofa.registry.common.model.Node; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Nov 20, 2020 24 | */ 25 | public interface RemoteServer { 26 | 27 | T getRemoteNode(); 28 | } 29 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/cluster/RemoteServers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.cluster; 18 | 19 | import com.alipay.sofa.registry.common.model.Node; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Nov 20, 2020 24 | */ 25 | public interface RemoteServers {} 26 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/cluster/node/NodeAdded.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.cluster.node; 18 | 19 | import com.alipay.sofa.registry.common.model.Node; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Nov 25, 2020 24 | */ 25 | public class NodeAdded extends AbstractNodeEvent { 26 | 27 | public NodeAdded(T node) { 28 | super(node); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/cluster/node/NodeEvent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.cluster.node; 18 | 19 | import com.alipay.sofa.registry.common.model.Node; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Nov 25, 2020 24 | */ 25 | public interface NodeEvent {} 26 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/cluster/node/NodeRemoved.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.cluster.node; 18 | 19 | import com.alipay.sofa.registry.common.model.Node; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Nov 25, 2020 24 | */ 25 | public class NodeRemoved extends AbstractNodeEvent { 26 | 27 | public NodeRemoved(T node) { 28 | super(node); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/lease/Evictable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.lease; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Mar 09, 2021 22 | */ 23 | public interface Evictable { 24 | 25 | /** Evict. */ 26 | void evict(); 27 | } 28 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/lease/LeaseFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.lease; 18 | 19 | import com.alipay.sofa.registry.common.model.Node; 20 | import com.alipay.sofa.registry.common.model.metaserver.Lease; 21 | 22 | /** 23 | * @author chen.zhu 24 | *

Mar 18, 2021 25 | */ 26 | public interface LeaseFilter { 27 | 28 | boolean allowSelect(Lease lease); 29 | } 30 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/lease/data/DataManagerObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.lease.data; 18 | 19 | import com.alipay.sofa.registry.observer.UnblockingObserver; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Dec 15, 2020 24 | */ 25 | public interface DataManagerObserver extends UnblockingObserver {} 26 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/lease/session/SessionManagerObserver.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.lease.session; 18 | 19 | import com.alipay.sofa.registry.observer.UnblockingObserver; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Dec 15, 2020 24 | */ 25 | public interface SessionManagerObserver extends UnblockingObserver {} 26 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/monitor/data/DataMessageListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.monitor.data; 18 | 19 | import com.alipay.sofa.registry.common.model.metaserver.nodes.DataNode; 20 | import com.alipay.sofa.registry.server.meta.monitor.heartbeat.HeartbeatListener; 21 | 22 | /** 23 | * @author chen.zhu 24 | *

Feb 23, 2021 25 | */ 26 | public interface DataMessageListener extends HeartbeatListener {} 27 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/monitor/heartbeat/HeartbeatListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.monitor.heartbeat; 18 | 19 | import com.alipay.sofa.registry.common.model.Node; 20 | import com.alipay.sofa.registry.common.model.metaserver.inter.heartbeat.HeartbeatRequest; 21 | 22 | /** 23 | * @author chen.zhu 24 | *

Feb 24, 2021 25 | */ 26 | public interface HeartbeatListener { 27 | void onHeartbeat(HeartbeatRequest heartbeat); 28 | } 29 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/monitor/session/SessionMessageListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.monitor.session; 18 | 19 | import com.alipay.sofa.registry.common.model.metaserver.nodes.SessionNode; 20 | import com.alipay.sofa.registry.server.meta.monitor.heartbeat.HeartbeatListener; 21 | 22 | /** 23 | * @author chen.zhu 24 | *

Feb 24, 2021 25 | */ 26 | public interface SessionMessageListener extends HeartbeatListener {} 27 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/provide/data/ProvideDataNotifier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.provide.data; 18 | 19 | import com.alipay.sofa.registry.common.model.metaserver.ProvideDataChangeEvent; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Dec 03, 2020 24 | */ 25 | public interface ProvideDataNotifier { 26 | 27 | void notifyProvideDataChange(ProvideDataChangeEvent event); 28 | } 29 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/remoting/data/DataServerService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.remoting.data; 18 | 19 | import com.alipay.sofa.registry.server.meta.remoting.notifier.Notifier; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Feb 23, 2021 24 | */ 25 | public interface DataServerService extends Notifier {} 26 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/remoting/session/SessionServerService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.remoting.session; 18 | 19 | import com.alipay.sofa.registry.server.meta.remoting.notifier.Notifier; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Feb 23, 2021 24 | */ 25 | public interface SessionServerService extends Notifier {} 26 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/slot/RebalanceTask.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.slot; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Nov 25, 2020 22 | */ 23 | public interface RebalanceTask extends Runnable {} 24 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/slot/SlotAllocator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.slot; 18 | 19 | import com.alipay.sofa.registry.common.model.slot.SlotTable; 20 | 21 | /** 22 | * @author yuzhi.lyz 23 | * @version v 0.1 2020-11-11 11:31 yuzhi.lyz Exp $ 24 | */ 25 | public interface SlotAllocator { 26 | SlotTable getSlotTable(); 27 | } 28 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/slot/SlotAssigner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.slot; 18 | 19 | import com.alipay.sofa.registry.common.model.slot.SlotTable; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Jan 15, 2021 24 | */ 25 | public interface SlotAssigner { 26 | 27 | SlotTable assign(); 28 | } 29 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/slot/SlotBalancer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.slot; 18 | 19 | import com.alipay.sofa.registry.common.model.slot.SlotTable; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Jan 15, 2021 24 | */ 25 | public interface SlotBalancer { 26 | 27 | SlotTable balance(); 28 | } 29 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/slot/assigner/ScoreStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.slot.assigner; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Jan 15, 2021 22 | */ 23 | public interface ScoreStrategy { 24 | 25 | int score(T t); 26 | } 27 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/slot/util/builder/Builder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.slot.util.builder; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Jan 12, 2021 22 | */ 23 | public interface Builder { 24 | T build(); 25 | } 26 | -------------------------------------------------------------------------------- /server/server/meta/src/main/java/com/alipay/sofa/registry/server/meta/slot/util/selector/Selector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.meta.slot.util.selector; 18 | 19 | import java.util.Collection; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Jan 15, 2021 24 | */ 25 | public interface Selector { 26 | 27 | T select(Collection candidates); 28 | } 29 | -------------------------------------------------------------------------------- /server/server/meta/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | nodes.localDataCenter=DefaultDataCenter 2 | #nodes.metaNode=DefaultDataCenter:localhost 3 | nodes.localRegion=DEFAULT_ZONE 4 | nodes.localSegmentRegions=DEFAULT_ZONE 5 | ## connect db 6 | jdbc.driverClassName=com.mysql.jdbc.Driver 7 | jdbc.url=jdbc:mysql://127.0.0.1:3306/registrymetadb?useUnicode=true&characterEncoding=utf8 8 | jdbc.username=root 9 | jdbc.password=root 10 | -------------------------------------------------------------------------------- /server/server/meta/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | __ __ _ ____ 3 | | \/ | ___| |_ __ _ / ___| ___ _ ____ _____ _ __ 4 | | |\/| |/ _ \ __/ _` | \___ \ / _ \ '__\ \ / / _ \ '__| 5 | | | | | __/ || (_| | ___) | __/ | \ V / __/ | 6 | |_| |_|\___|\__\__,_| |____/ \___|_| \_/ \___|_| 7 | -------------------------------------------------------------------------------- /server/server/meta/src/test/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | spring.main.banner-mode=LOG 2 | #nodes.metaNode=DefaultDataCenter:localhost 3 | nodes.localDataCenter=DefaultDataCenter 4 | nodes.localRegion=DEFAULT_ZONE 5 | nodes.localSegmentRegions=DEFAULT_ZONE 6 | #server.logging.home=/home/admin/logs/registry 7 | 8 | ## connect db 9 | spring.h2.console.enabled=true 10 | jdbc.driverClassName=org.h2.Driver 11 | jdbc.url=jdbc:h2:mem:metadatadb;DB_CLOSE_DELAY=-1;MODE=MySQL;MV_STORE=FALSE 12 | jdbc.username=sa 13 | jdbc.password= 14 | spring.datasource.schema=sql/h2/create_table.sql 15 | #spring.datasource.data=sql/h2/base_info.sql 16 | 17 | #jdbc.typeAliasesPackage=com.alipay.sofa.registry.jdbc.domain 18 | jdbc.mapperLocations=classpath:h2-mapper/*.xml 19 | -------------------------------------------------------------------------------- /server/server/meta/src/test/resources/sql/h2/base_info.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sofastack/sofa-registry/ac38b856fff1421b08f1f86a391adf58de86c722/server/server/meta/src/test/resources/sql/h2/base_info.sql -------------------------------------------------------------------------------- /server/server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | com.alipay.sofa 7 | registry-server-parent 8 | 6.6.0 9 | ../pom.xml 10 | 11 | 4.0.0 12 | 13 | registry-server 14 | pom 15 | 16 | 17 | ../../ 18 | 19 | 20 | 21 | session 22 | data 23 | meta 24 | integration 25 | shared 26 | 27 | 28 | 29 | 30 | com.alipay.sofa 31 | registry-common-util 32 | 33 | 34 | 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/acceptor/WriteDataAcceptor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.acceptor; 18 | 19 | /** 20 | * @author kezhu.wukz 21 | * @author shangyu.wh 22 | * @version 1.0: WriteDataAcceptor.java, v 0.1 2019-06-11 15:08 shangyu.wh Exp $ 23 | */ 24 | public interface WriteDataAcceptor { 25 | 26 | /** 27 | * accept all write data request 28 | * 29 | * @param request request 30 | */ 31 | void accept(WriteDataRequest request); 32 | } 33 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/bootstrap/MultiClusterSessionServerConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.bootstrap; 18 | 19 | /** 20 | * @author xiaojian.xj 21 | * @version : MultiClusterSessionServerConfig.java, v 0.1 2022年07月29日 15:31 xiaojian.xj Exp $ 22 | */ 23 | public interface MultiClusterSessionServerConfig { 24 | long getMultiClusterConfigReloadSecs(); 25 | } 26 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/cache/CacheAccessException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.cache; 18 | 19 | /** 20 | * exception inner cache, e.g. remote invoke error 21 | * 22 | * @author kezhu.wukz 23 | * @version $Id: CacheAccessException.java, v 0.1 2019-09-02 17:55 kezhu.wukz Exp $ 24 | */ 25 | public class CacheAccessException extends RuntimeException { 26 | 27 | public CacheAccessException(String message, Throwable cause) { 28 | super(message, cause); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/cache/CacheGenerator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.cache; 18 | 19 | /** 20 | * @author shangyu.wh 21 | * @version $Id: CacheGenerator.java, v 0.1 2017-12-06 17:29 shangyu.wh Exp $ 22 | */ 23 | public interface CacheGenerator { 24 | 25 | /** 26 | * generator cache on write request 27 | * 28 | * @param key key 29 | * @return Value 30 | */ 31 | Value generatePayload(Key key); 32 | } 33 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/cache/EntityType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.cache; 18 | 19 | /** 20 | * @author shangyu.wh 21 | * @version $Id: EntityType.java, v 0.1 2017-12-06 15:52 shangyu.wh Exp $ 22 | */ 23 | public interface EntityType { 24 | 25 | /** symbol : */ 26 | char COMMA = ','; 27 | 28 | /** 29 | * cache contents uniqueKey,use for make up Key' hash code 30 | * 31 | * @return String 32 | */ 33 | String getUniqueKey(); 34 | } 35 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/converter/Converter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.converter; 18 | 19 | /** 20 | * @author shangyu.wh 21 | * @version $Id: Converter.java, v 0.1 2017-11-29 11:55 shangyu.wh Exp $ source type target type 22 | */ 23 | public interface Converter { 24 | 25 | T convert(S source); 26 | } 27 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/filter/IPMatchStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.filter; 18 | 19 | import java.util.function.Supplier; 20 | 21 | /** 22 | * @author shangyu.wh 23 | * @version 1.0: IPMatchStrategy.java, v 0.1 2019-06-19 22:14 shangyu.wh Exp $ 24 | */ 25 | public interface IPMatchStrategy { 26 | 27 | boolean match(String IP, Supplier getOperatorType); 28 | } 29 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/filter/ProcessFilter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.filter; 18 | 19 | /** 20 | * @author shangyu.wh 21 | * @version 1.0: ProcessFilter.java, v 0.1 2019-06-19 17:01 shangyu.wh Exp $ 22 | */ 23 | public interface ProcessFilter { 24 | 25 | boolean match(T input); 26 | } 27 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/limit/AccessLimitService.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.limit; 18 | 19 | /** 20 | * @author shangyu.wh 21 | * @version 1.0: AccessLimitService.java, v 0.1 2019-08-26 20:35 shangyu.wh Exp $ 22 | */ 23 | public interface AccessLimitService { 24 | boolean tryAcquire(); 25 | } 26 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/push/PushLog.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.push; 18 | 19 | import com.alipay.sofa.registry.log.Logger; 20 | import com.alipay.sofa.registry.log.LoggerFactory; 21 | import org.apache.logging.log4j.core.async.Hack; 22 | 23 | public final class PushLog { 24 | public static final Logger LOGGER = 25 | Hack.hackLoggerDisruptor(LoggerFactory.getLogger(PushLog.class)); 26 | 27 | private PushLog() {} 28 | } 29 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/push/PushType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.push; 18 | 19 | public enum PushType { 20 | Sub(false), 21 | Reg(false), 22 | Temp(true), 23 | Empty(true); 24 | 25 | public final boolean noDelay; 26 | 27 | private PushType(boolean noDelay) { 28 | this.noDelay = noDelay; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/store/Watchers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.store; 18 | 19 | import com.alipay.sofa.registry.common.model.store.Watcher; 20 | 21 | /** 22 | * @author shangyu.wh 23 | * @version $Id: SessionInterests.java, v 0.1 2017-11-30 15:53 shangyu.wh Exp $ 24 | */ 25 | public interface Watchers extends DataManager {} 26 | -------------------------------------------------------------------------------- /server/server/session/src/main/java/com/alipay/sofa/registry/server/session/strategy/SyncConfigHandlerStrategy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.strategy; 18 | 19 | import com.alipay.sofa.registry.core.model.SyncConfigResponse; 20 | 21 | /** 22 | * @author xuanbei 23 | * @since 2019/2/15 24 | */ 25 | public interface SyncConfigHandlerStrategy { 26 | void handleSyncConfigResponse(SyncConfigResponse syncConfigResponse); 27 | } 28 | -------------------------------------------------------------------------------- /server/server/session/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | nodes.localDataCenter=DefaultDataCenter 2 | #nodes.metaNode=DefaultDataCenter:localhost 3 | nodes.localRegion=DEFAULT_ZONE 4 | nodes.localSegmentRegions=DEFAULT_ZONE 5 | ## connect db 6 | #persistence.profile.active=jdbc 7 | jdbc.driverClassName=com.mysql.jdbc.Driver 8 | jdbc.url=jdbc:mysql://127.0.0.1:3306/registrymetadb?useUnicode=true&characterEncoding=utf8 9 | jdbc.username=root 10 | jdbc.password=root 11 | session.server.gracefulShutdown=true 12 | -------------------------------------------------------------------------------- /server/server/session/src/main/resources/banner.txt: -------------------------------------------------------------------------------- 1 | 2 | ____ _ ____ 3 | / ___| ___ ___ ___(_) ___ _ __ / ___| ___ _ ____ _____ _ __ 4 | \___ \ / _ \/ __/ __| |/ _ \| '_ \ \___ \ / _ \ '__\ \ / / _ \ '__| 5 | ___) | __/\__ \__ \ | (_) | | | | ___) | __/ | \ V / __/ | 6 | |____/ \___||___/___/_|\___/|_| |_| |____/ \___|_| \_/ \___|_| 7 | -------------------------------------------------------------------------------- /server/server/session/src/test/java/com/alipay/sofa/registry/server/session/resource/CompressResourceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.resource; 18 | 19 | import com.alipay.sofa.registry.server.session.providedata.CompressPushService; 20 | import org.junit.Test; 21 | 22 | public class CompressResourceTest { 23 | 24 | @Test 25 | public void test() { 26 | CompressResource resource = new CompressResource(); 27 | resource.compressPushService = new CompressPushService(); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /server/server/session/src/test/java/com/alipay/sofa/registry/server/session/store/BaseTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.store; 18 | 19 | import org.springframework.boot.SpringBootConfiguration; 20 | 21 | /** 22 | * @author shangyu.wh 23 | * @version $Id: BaseTest.java, v 0.1 2017-12-14 21:47 shangyu.wh Exp $ 24 | */ 25 | @SpringBootConfiguration 26 | public class BaseTest {} 27 | -------------------------------------------------------------------------------- /server/server/session/src/test/java/com/alipay/sofa/registry/server/session/strategy/impl/MetricsTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.session.strategy.impl; 18 | 19 | import org.junit.Test; 20 | 21 | public class MetricsTest { 22 | @Test 23 | public void testMetrics() { 24 | Metrics.Access.pubSize("registry", "SOFA", 100); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /server/server/shared/src/main/java/com/alipay/sofa/registry/server/shared/comparator/Comparator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.shared.comparator; 18 | 19 | import java.util.Set; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Jan 12, 2021 24 | */ 25 | public interface Comparator { 26 | 27 | Set getAdded(); 28 | 29 | Set getRemoved(); 30 | 31 | boolean hasAnyChange(); 32 | 33 | int totalChange(); 34 | } 35 | -------------------------------------------------------------------------------- /server/server/shared/src/main/java/com/alipay/sofa/registry/server/shared/config/ServerShareConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.shared.config; 18 | 19 | /** 20 | * @author xiaojian.xj 21 | * @version $Id: ServerShareConfig.java, v 0.1 2021年05月16日 13:51 xiaojian.xj Exp $ 22 | */ 23 | public interface ServerShareConfig { 24 | 25 | int getSystemPropertyIntervalMillis(); 26 | } 27 | -------------------------------------------------------------------------------- /server/server/shared/src/main/java/com/alipay/sofa/registry/server/shared/providedata/ProvideDataProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.shared.providedata; 18 | 19 | import com.alipay.sofa.registry.common.model.metaserver.ProvideData; 20 | 21 | /** 22 | * @author shangyu.wh 23 | * @version 1.0: ProvideDataProcessor.java, v 0.1 2019-10-09 17:26 shangyu.wh Exp $ 24 | */ 25 | public interface ProvideDataProcessor { 26 | 27 | boolean support(String dataInfoId); 28 | 29 | boolean processData(ProvideData data); 30 | } 31 | -------------------------------------------------------------------------------- /server/server/shared/src/main/java/com/alipay/sofa/registry/server/shared/providedata/SystemDataStorage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.shared.providedata; 18 | 19 | public abstract class SystemDataStorage { 20 | final long version; 21 | 22 | public SystemDataStorage(long version) { 23 | this.version = version; 24 | } 25 | 26 | /** 27 | * Getter method for property version. 28 | * 29 | * @return property value of version 30 | */ 31 | public long getVersion() { 32 | return version; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /server/server/shared/src/main/java/com/alipay/sofa/registry/server/shared/slot/SlotTableRecorder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.shared.slot; 18 | 19 | import com.alipay.sofa.registry.common.model.slot.SlotTable; 20 | 21 | /** 22 | * @author chen.zhu 23 | *

Dec 25, 2020 24 | */ 25 | public interface SlotTableRecorder { 26 | 27 | void record(SlotTable slotTable); 28 | } 29 | -------------------------------------------------------------------------------- /server/server/shared/src/test/java/com/alipay/sofa/registry/server/shared/resource/MetricsResourceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.server.shared.resource; 18 | 19 | import javax.ws.rs.core.Response; 20 | import org.junit.Assert; 21 | import org.junit.Test; 22 | 23 | public class MetricsResourceTest { 24 | @Test 25 | public void test() { 26 | MetricsResource resource = new MetricsResource(); 27 | Response response = resource.metrics(); 28 | Assert.assertEquals(response.getStatus(), 200); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server/store/api/src/main/java/com/alipay/sofa/registry/store/api/OperationStatus.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.store.api; 18 | 19 | /** 20 | * @author xuanbei 21 | * @since 2019/2/12 22 | */ 23 | public enum OperationStatus { 24 | /** The operation was successful. */ 25 | SUCCESS, 26 | 27 | /** The requested key/data pair was not found. */ 28 | NOTFOUND 29 | } 30 | -------------------------------------------------------------------------------- /server/store/api/src/main/java/com/alipay/sofa/registry/store/api/date/DateNowRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.store.api.date; 18 | 19 | import java.util.Date; 20 | 21 | /** 22 | * @author xiaojian.xj 23 | * @version : DateNowRepository.java, v 0.1 2021年09月29日 15:06 xiaojian.xj Exp $ 24 | */ 25 | public interface DateNowRepository { 26 | Date getNow(); 27 | } 28 | -------------------------------------------------------------------------------- /server/store/api/src/main/java/com/alipay/sofa/registry/store/api/elector/DistributeLockRepository.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.store.api.elector; 18 | 19 | import com.alipay.sofa.registry.common.model.elector.DistributeLockInfo; 20 | 21 | /** 22 | * @author xiaojian.xj 23 | * @version : DistributeLockRepository.java, v 0.1 2022年08月06日 16:59 xiaojian.xj Exp $ 24 | */ 25 | public interface DistributeLockRepository { 26 | 27 | DistributeLockInfo queryDistLock(String lockName); 28 | } 29 | -------------------------------------------------------------------------------- /server/store/api/src/main/java/com/alipay/sofa/registry/store/api/elector/LeaderAware.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.store.api.elector; 18 | 19 | /** 20 | * @author chen.zhu 21 | *

Nov 21, 2020 22 | */ 23 | public interface LeaderAware { 24 | /** notify listeners when I'm elector. */ 25 | void leaderNotify(); 26 | 27 | /** notify listeners when I'm not elector. */ 28 | void followNotify(); 29 | } 30 | -------------------------------------------------------------------------------- /server/store/api/src/main/java/com/alipay/sofa/registry/store/api/meta/DbEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.store.api.meta; 18 | 19 | import java.util.Date; 20 | 21 | public interface DbEntry { 22 | long getId(); 23 | 24 | Date getGmtCreate(); 25 | } 26 | -------------------------------------------------------------------------------- /server/store/api/src/main/java/com/alipay/sofa/registry/store/api/meta/RecoverConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.store.api.meta; 18 | 19 | /** 20 | * @author xiaojian.xj 21 | * @version : RecoverConfig.java, v 0.1 2021年09月27日 21:23 xiaojian.xj Exp $ 22 | */ 23 | public interface RecoverConfig { 24 | 25 | String tableName(); 26 | 27 | default boolean afterConfigSet(String key, String recoverClusterId) { 28 | return true; 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /server/store/api/src/main/java/com/alipay/sofa/registry/store/api/multi/MultiDataCenterListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.store.api.multi; 18 | 19 | import java.util.Set; 20 | 21 | /** 22 | * @author xiaojian.xj 23 | * @version : MultiDataCenterListener.java, v 0.1 2022年07月28日 15:19 xiaojian.xj Exp $ 24 | */ 25 | public interface MultiDataCenterListener { 26 | 27 | Set dataCenters(); 28 | 29 | void setDataCenters(Set dataCenters); 30 | } 31 | -------------------------------------------------------------------------------- /server/store/jdbc/src/main/java/com/alipay/sofa/registry/jdbc/config/MetaElectorConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.jdbc.config; 18 | 19 | /** 20 | * @author xiaojian.xj 21 | * @version $Id: MetaElectorConfig.java, v 0.1 2021年03月17日 16:49 xiaojian.xj Exp $ 22 | */ 23 | public interface MetaElectorConfig { 24 | 25 | long getLockExpireDuration(); 26 | } 27 | -------------------------------------------------------------------------------- /server/store/jdbc/src/main/java/com/alipay/sofa/registry/jdbc/domain/DateNowDomain.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.jdbc.domain; 18 | 19 | import java.util.Date; 20 | 21 | public class DateNowDomain { 22 | public DateNowDomain() {} 23 | 24 | public DateNowDomain(Date now) { 25 | this.now = now; 26 | } 27 | 28 | private Date now; 29 | 30 | public Date getNow() { 31 | return now; 32 | } 33 | 34 | public void setNow(Date now) { 35 | this.now = now; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /server/store/jdbc/src/main/java/com/alipay/sofa/registry/jdbc/exception/AppRevisionQueryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.jdbc.exception; 18 | 19 | /** 20 | * @author xiaojian.xj 21 | * @version $Id: AppRevisionQueryException.java, v 0.1 2021年02月03日 15:59 xiaojian.xj Exp $ 22 | */ 23 | public class AppRevisionQueryException extends RuntimeException { 24 | 25 | public AppRevisionQueryException(String revision, String msg) { 26 | super(String.format("query revision: %s error, errorMsg: %s", revision, msg)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /server/store/jdbc/src/main/java/com/alipay/sofa/registry/jdbc/exception/InterfaceAppQueryException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.jdbc.exception; 18 | 19 | /** 20 | * @author xiaojian.xj 21 | * @version $Id: RevisionNotExistException.java, v 0.1 2021年02月03日 15:59 xiaojian.xj Exp $ 22 | */ 23 | public class InterfaceAppQueryException extends RuntimeException { 24 | 25 | public InterfaceAppQueryException(String service) { 26 | super(String.format("query apps by service: %s error.", service)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /server/store/jdbc/src/main/java/com/alipay/sofa/registry/jdbc/exception/RevisionNotExistException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.jdbc.exception; 18 | 19 | /** 20 | * @author xiaojian.xj 21 | * @version $Id: RevisionNotExistException.java, v 0.1 2021年02月03日 15:59 xiaojian.xj Exp $ 22 | */ 23 | public class RevisionNotExistException extends RuntimeException { 24 | 25 | public RevisionNotExistException(String revision) { 26 | super(String.format("revision: %s not exist.", revision)); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /server/store/jdbc/src/main/java/com/alipay/sofa/registry/jdbc/informer/DbEntryContainer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.jdbc.informer; 18 | 19 | import com.alipay.sofa.registry.store.api.meta.DbEntry; 20 | 21 | public interface DbEntryContainer { 22 | void onEntry(T entry); 23 | } 24 | -------------------------------------------------------------------------------- /server/store/jdbc/src/main/java/com/alipay/sofa/registry/jdbc/mapper/DateNowMapper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.jdbc.mapper; 18 | 19 | import com.alipay.sofa.registry.jdbc.domain.DateNowDomain; 20 | 21 | /** 22 | * @author xiaojian.xj 23 | * @version : DateNowMapper.java, v 0.1 2021年09月29日 15:03 xiaojian.xj Exp $ 24 | */ 25 | public interface DateNowMapper { 26 | DateNowDomain getNow(); 27 | } 28 | -------------------------------------------------------------------------------- /server/store/jdbc/src/main/java/com/alipay/sofa/registry/jdbc/version/config/ConfigEntry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | package com.alipay.sofa.registry.jdbc.version.config; 18 | 19 | /** 20 | * @author xiaojian.xj 21 | * @version : ConfigEntry.java, v 0.1 2022年04月15日 14:55 xiaojian.xj Exp $ 22 | */ 23 | public interface ConfigEntry { 24 | 25 | public long getDataVersion(); 26 | } 27 | -------------------------------------------------------------------------------- /server/store/jdbc/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | ## connect db 19 | jdbc.url = jdbc:mysql://127.0.0.1:3306/registrymetadb?useUnicode=true&characterEncoding=utf8 20 | jdbc.username = root 21 | jdbc.password = root 22 | 23 | 24 | -------------------------------------------------------------------------------- /server/store/jdbc/src/main/resources/h2-mapper/date_now.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | -------------------------------------------------------------------------------- /server/store/jdbc/src/main/resources/mapper/date_now.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 13 | -------------------------------------------------------------------------------- /server/store/jdbc/src/main/resources/sql/h2/base_info.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sofastack/sofa-registry/ac38b856fff1421b08f1f86a391adf58de86c722/server/store/jdbc/src/main/resources/sql/h2/base_info.sql -------------------------------------------------------------------------------- /server/store/jdbc/src/test/resources/application-test.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Licensed to the Apache Software Foundation (ASF) under one or more 3 | # contributor license agreements. See the NOTICE file distributed with 4 | # this work for additional information regarding copyright ownership. 5 | # The ASF licenses this file to You under the Apache License, Version 2.0 6 | # (the "License"); you may not use this file except in compliance with 7 | # the License. You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # 17 | 18 | ## connect db 19 | spring.h2.console.enabled=true 20 | #persistence.profile.active=jdbc 21 | jdbc.driverClassName=org.h2.Driver 22 | jdbc.url=jdbc:h2:mem:metadatadb;DB_CLOSE_DELAY=-1;MODE=MySQL;MV_STORE=FALSE 23 | jdbc.username=sa 24 | jdbc.password= 25 | spring.datasource.schema=sql/h2/create_table.sql 26 | #spring.datasource.data=sql/h2/base_info.sql 27 | 28 | #jdbc.typeAliasesPackage=com.alipay.sofa.registry.jdbc.domain 29 | jdbc.mapperLocations=classpath:h2-mapper/*.xml 30 | -------------------------------------------------------------------------------- /server/store/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | com.alipay.sofa 7 | registry-server-parent 8 | 6.6.0 9 | ../pom.xml 10 | 11 | 4.0.0 12 | registry-store 13 | pom 14 | 15 | 16 | ../../ 17 | 18 | 19 | 20 | api 21 | jraft 22 | jdbc 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/src/main/resources/sql/h2/base_info.sql: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sofastack/sofa-registry/ac38b856fff1421b08f1f86a391adf58de86c722/test/src/main/resources/sql/h2/base_info.sql -------------------------------------------------------------------------------- /tools/change_version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | shellDir=$(cd "$(dirname "$0")"; pwd) 3 | 4 | shopt -s expand_aliases 5 | if [ ! -n "$1" ] ;then 6 | echo "Please enter a version" 7 | exit 1 8 | else 9 | echo "The version is $1 !" 10 | fi 11 | 12 | if [ `uname` == "Darwin" ] ;then 13 | echo "This is OS X" 14 | alias sed='sed -i ""' 15 | else 16 | echo "This is Linux" 17 | alias sed='sed -i' 18 | fi 19 | 20 | cd $shellDir/.. 21 | echo "Change version in registry-parent ===>" 22 | sed "// s/[^\$].*<\/version>/$1<\/version>/" ./pom.xml 23 | 24 | echo "Change version in registry-client-all ===>" 25 | sed "/[^\$].*<\/version>/$1<\/version>/" ./client/all/pom.xml 26 | 27 | echo "Change version in subproject pom ===>" 28 | for filename in `find . -name "pom.xml" -maxdepth 4`;do 29 | if [ $filename == "./client/all/pom.xml" ]; then 30 | continue 31 | fi 32 | echo "Deal with $filename" 33 | sed "//,/<\/parent>/ s/[^\$].*<\/version>/$1<\/version>/" $filename 34 | done 35 | 36 | #TODO 37 | #echo "Change version in server shell ===>" -------------------------------------------------------------------------------- /tools/check_format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BASEDIR=$(dirname $0) 4 | 5 | cd ${BASEDIR} 6 | 7 | # make sure git has no un commit files 8 | if [ -n "$(git status --untracked-files=no --porcelain)" ]; then 9 | echo "Please commit your change before run this shell, un commit files:" 10 | git status --untracked-files=no --porcelain 11 | exit 1 12 | fi -------------------------------------------------------------------------------- /tools/codestyle/HEADER: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | --------------------------------------------------------------------------------