Package com.linkedin.venice.server
Class VeniceServer
- java.lang.Object
-
- com.linkedin.venice.server.VeniceServer
-
public class VeniceServer extends java.lang.Object
Class that represents the Venice server. It is responsible for maintaining the lifecycle of multiple internal services including e.g. service start/stop operations and making sure that it is done in the right order based on their dependencies.
-
-
Constructor Summary
Constructors Constructor Description VeniceServer(VeniceConfigLoader veniceConfigLoader, io.tehuti.metrics.MetricsRepository metricsRepository, java.util.Optional<SSLFactory> sslFactory, java.util.Optional<StaticAccessController> routerAccessController, java.util.Optional<DynamicAccessController> storeAccessController, java.util.Optional<ClientConfig> clientConfigForConsumer, ICProvider icProvider, java.util.List<ServiceDiscoveryAnnouncer> serviceDiscoveryAnnouncers)
Deprecated.UseVeniceServer(VeniceServerContext)
instead.VeniceServer(VeniceServerContext ctx)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected ListenerService
createListenerService(StorageEngineRepository storageEngineRepository, ReadOnlyStoreRepository storeMetadataRepository, ReadOnlySchemaRepository schemaRepository, java.util.concurrent.CompletableFuture<HelixCustomizedViewOfflinePushRepository> customizedViewRepository, IngestionMetadataRetriever ingestionMetadataRetriever, ReadMetadataRetriever readMetadataRetriever, VeniceServerConfig serverConfig, io.tehuti.metrics.MetricsRepository metricsRepository, java.util.Optional<SSLFactory> sslFactory, java.util.Optional<StaticAccessController> routerAccessController, java.util.Optional<DynamicAccessController> storeAccessController, DiskHealthCheckService diskHealthService, StorageEngineBackedCompressorFactory compressorFactory, java.util.Optional<ResourceReadUsageTracker> resourceReadUsageTracker)
protected VeniceConfigLoader
getConfigLoader()
HeartbeatMonitoringService
getHeartbeatMonitoringService()
HelixParticipationService
getHelixParticipationService()
KafkaStoreIngestionService
getKafkaStoreIngestionService()
io.tehuti.metrics.MetricsRepository
getMetricsRepository()
StorageMetadataService
getStorageMetadataService()
StorageService
getStorageService()
protected static boolean
isServerInAllowList(java.lang.String zkAddress, java.lang.String clusterName, java.lang.String hostname, int listenPort, boolean enableServerAllowlist)
boolean
isStarted()
static void
main(java.lang.String[] args)
static void
run(VeniceConfigLoader veniceConfigService, boolean joinThread)
static void
run(java.lang.String configDirectory, boolean joinThread)
void
shutdown()
Method which closes VeniceServer, shuts down its resources, and exits the JVM.void
start()
Method which starts the services instantiate earlier.
-
-
-
Constructor Detail
-
VeniceServer
@Deprecated public VeniceServer(VeniceConfigLoader veniceConfigLoader, io.tehuti.metrics.MetricsRepository metricsRepository, java.util.Optional<SSLFactory> sslFactory, java.util.Optional<StaticAccessController> routerAccessController, java.util.Optional<DynamicAccessController> storeAccessController, java.util.Optional<ClientConfig> clientConfigForConsumer, ICProvider icProvider, java.util.List<ServiceDiscoveryAnnouncer> serviceDiscoveryAnnouncers)
Deprecated.UseVeniceServer(VeniceServerContext)
instead. Constructor kept for maintaining the backward compatibility Allocates a newVeniceServer
object.- Parameters:
veniceConfigLoader
- a config loader to load configs related to cluster and server.metricsRepository
- a registry for reporting metrics.sslFactory
- ssl certificate for enabling HTTP2.routerAccessController
- validates the accesses/requests from routers.storeAccessController
- validates the accesses/requests from clients.clientConfigForConsumer
- kafka client configurations.icProvider
- Provide IC(invocation-context) to remote calls inside services.serviceDiscoveryAnnouncers
- list of server discovery announcers- See Also:
VeniceConfigLoader
,ServerStoreAclHandler
-
VeniceServer
public VeniceServer(VeniceServerContext ctx) throws VeniceException
- Throws:
VeniceException
-
-
Method Detail
-
getStorageService
public StorageService getStorageService()
-
getStorageMetadataService
public StorageMetadataService getStorageMetadataService()
-
getKafkaStoreIngestionService
public KafkaStoreIngestionService getKafkaStoreIngestionService()
-
getHelixParticipationService
public HelixParticipationService getHelixParticipationService()
-
getHeartbeatMonitoringService
public HeartbeatMonitoringService getHeartbeatMonitoringService()
-
isStarted
public boolean isStarted()
- Returns:
- true if the
VeniceServer
and all of its inner services are fully started false if theVeniceServer
was not started or if any of its inner services are not finished starting.
-
start
public void start() throws VeniceException
Method which starts the services instantiate earlier.- Throws:
java.lang.Exception
VeniceException
-
shutdown
public void shutdown() throws VeniceException
Method which closes VeniceServer, shuts down its resources, and exits the JVM.- Throws:
VeniceException
-
isServerInAllowList
protected static boolean isServerInAllowList(java.lang.String zkAddress, java.lang.String clusterName, java.lang.String hostname, int listenPort, boolean enableServerAllowlist)
-
getConfigLoader
protected VeniceConfigLoader getConfigLoader()
-
getMetricsRepository
public io.tehuti.metrics.MetricsRepository getMetricsRepository()
-
createListenerService
protected ListenerService createListenerService(StorageEngineRepository storageEngineRepository, ReadOnlyStoreRepository storeMetadataRepository, ReadOnlySchemaRepository schemaRepository, java.util.concurrent.CompletableFuture<HelixCustomizedViewOfflinePushRepository> customizedViewRepository, IngestionMetadataRetriever ingestionMetadataRetriever, ReadMetadataRetriever readMetadataRetriever, VeniceServerConfig serverConfig, io.tehuti.metrics.MetricsRepository metricsRepository, java.util.Optional<SSLFactory> sslFactory, java.util.Optional<StaticAccessController> routerAccessController, java.util.Optional<DynamicAccessController> storeAccessController, DiskHealthCheckService diskHealthService, StorageEngineBackedCompressorFactory compressorFactory, java.util.Optional<ResourceReadUsageTracker> resourceReadUsageTracker)
-
main
public static void main(java.lang.String[] args) throws java.lang.Exception
- Throws:
java.lang.Exception
-
run
public static void run(java.lang.String configDirectory, boolean joinThread) throws java.lang.Exception
- Throws:
java.lang.Exception
-
run
public static void run(VeniceConfigLoader veniceConfigService, boolean joinThread) throws java.lang.Exception
- Throws:
java.lang.Exception
-
-