code
stringlengths
23
201k
docstring
stringlengths
17
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
72
path
stringlengths
11
317
url
stringlengths
57
377
license
stringclasses
7 values
@RequestMapping(value = "/namespaces/{namespace:.+}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_UTF8_VALUE) public ResponseEntity<Object> query(@PathVariable("namespace") String namespace) throws SaturnJobConsoleException { HttpHeaders httpHeaders = new HttpHeaders(); try { checkMissingP...
RESTful APIs of namespace management. @author kfchu
query
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/controller/rest/NamespaceManagementRestApiController.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/controller/rest/NamespaceManagementRestApiController.java
Apache-2.0
private NamespaceDomainInfo constructNamespaceDomainInfo(Map<String, Object> reqParams) throws SaturnJobConsoleException { NamespaceDomainInfo namespaceInfo = new NamespaceDomainInfo(); namespaceInfo.setNamespace(checkAndGetParametersValueAsString(reqParams, "namespace", true)); namespaceInfo.setZkCluster(che...
RESTful APIs of namespace management. @author kfchu
constructNamespaceDomainInfo
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/controller/rest/NamespaceManagementRestApiController.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/controller/rest/NamespaceManagementRestApiController.java
Apache-2.0
public String getNamespace() { return namespace; }
The class used for store the zk and db diffByNamespace data.
getNamespace
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/JobDiffInfo.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/JobDiffInfo.java
Apache-2.0
public String getJobName() { return jobName; }
The class used for store the zk and db diffByNamespace data.
getJobName
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/JobDiffInfo.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/JobDiffInfo.java
Apache-2.0
public DiffType getDiffType() { return diffType; }
The class used for store the zk and db diffByNamespace data.
getDiffType
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/JobDiffInfo.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/JobDiffInfo.java
Apache-2.0
public List<ConfigDiffInfo> getConfigDiffInfos() { return configDiffInfos; }
The class used for store the zk and db diffByNamespace data.
getConfigDiffInfos
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/JobDiffInfo.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/JobDiffInfo.java
Apache-2.0
public void initNameAndNamespace() { // namespace cannot be null, i am sure. But the name could be. if (name != null) { this.nameAndNamespace = name + SLASH + namespace; } else { this.nameAndNamespace = SLASH + namespace; } }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
initNameAndNamespace
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public String getZkAlias() { return zkAlias; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
getZkAlias
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public void setZkAlias(String zkAlias) { this.zkAlias = zkAlias; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
setZkAlias
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public String getZkClusterKey() { return zkClusterKey; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
getZkClusterKey
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public void setZkClusterKey(String zkClusterKey) { this.zkClusterKey = zkClusterKey; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
setZkClusterKey
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public String getName() { return this.name; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
getName
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public void setName(String name) { this.name = name; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
setName
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public String getZkAddressList() { return this.zkAddressList; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
getZkAddressList
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public void setZkAddressList(String zkAddressList) { this.zkAddressList = zkAddressList; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
setZkAddressList
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public String getNamespace() { return this.namespace; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
getNamespace
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public void setNamespace(String namespace) { this.namespace = namespace; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
setNamespace
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public String getDigest() { return this.digest; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
getDigest
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public void setDigest(String digest) { this.digest = digest; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
setDigest
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public String getNameAndNamespace() { return this.nameAndNamespace; }
before invoke this method, be sure that the name and namespace are set, and the namespace cannot be null
getNameAndNamespace
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/RegistryCenterConfiguration.java
Apache-2.0
public static ServerStatus getServerStatus(final String status) { if (null == status) { return ServerStatus.OFFLINE; } return ServerStatus.ONLINE; }
if the status ephemeral node doesn't exist, it's offline. @param status should be ready or running or null.
getServerStatus
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/ServerStatus.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/domain/ServerStatus.java
Apache-2.0
protected void handleRefreshAuthCache() throws SaturnJobConsoleException { if (!isAuthorizationEnabled()) { rolesCache.clear(); return; } List<Role> roles = roleRepository.selectAll(); if (roles == null || roles.isEmpty()) { rolesCache.clear(); return; } ConcurrentMap<String, Role> rolesMap = ...
You could override this method to implement yourself caches @throws SaturnJobConsoleException exception
handleRefreshAuthCache
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/AuthorizationServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/AuthorizationServiceImpl.java
Apache-2.0
@Override public boolean isAuthorizationEnabled() throws SaturnJobConsoleException { return systemConfigService .getBooleanValue(SystemConfigProperties.AUTHORIZATION_ENABLED, authorizationEnabledDefault); }
You could override this method to implement yourself caches @throws SaturnJobConsoleException exception
isAuthorizationEnabled
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/AuthorizationServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/AuthorizationServiceImpl.java
Apache-2.0
@Transactional(readOnly = true) @Override public User getUser(String userName) throws SaturnJobConsoleException { User user = null; if (!isAuthorizationEnabled()) { return constructAvailableUser(user, userName); } user = constructAvailableUser(userRepository.select(userName), userName); List<UserRole> u...
You could override this method to implement yourself caches @throws SaturnJobConsoleException exception
getUser
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/AuthorizationServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/AuthorizationServiceImpl.java
Apache-2.0
protected User constructAvailableUser(User user, String userName) { if (user == null) { user = new User(); } user.setUserName(userName); if (user.getUserRoles() == null) { user.setUserRoles(new ArrayList<UserRole>()); } return user; }
You could override this method to implement yourself caches @throws SaturnJobConsoleException exception
constructAvailableUser
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/AuthorizationServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/AuthorizationServiceImpl.java
Apache-2.0
@Transactional(readOnly = true) @Override public boolean hasUserRole(UserRole userRole) throws SaturnJobConsoleException { if (!isAuthorizationEnabled()) { return true; } List<UserRole> result = userRoleRepository.select(userRole); return result != null && !result.isEmpty(); }
You could override this method to implement yourself caches @throws SaturnJobConsoleException exception
hasUserRole
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/AuthorizationServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/AuthorizationServiceImpl.java
Apache-2.0
private void closeZkCluster(ZkCluster zkCluster) { try { try { DashboardLeaderHandler dashboardLeaderHandler = dashboardLeaderTreeCacheMap .remove(zkCluster.getZkClusterKey()); if (dashboardLeaderHandler != null) { dashboardLeaderHandler.shutdown(); } } catch (Exception e) { log.error...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
closeZkCluster
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
private void createNewConnect(final ZkCluster zkCluster) { String zkAddr = zkCluster.getZkAddr(); try { final CuratorFramework curatorFramework = curatorRepository.connect(zkAddr, null, zkCluster.getDigest()); if (curatorFramework == null) { log.error("found an offline zkCluster, zkAddr is {}", zkAddr); ...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
createNewConnect
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public void stop() { zkCluster.setOffline(true); }
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
stop
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public void restart() { try { zkCluster.setOffline(false); updateExecutorConfigToZkIfNecessary(zkCluster); } catch (Exception e) { log.error(e.getMessage(), e); } }
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
restart
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
private JSONObject parseExecutorConfigJson(String jsonStr) { if (StringUtils.isBlank(jsonStr)) { return new JSONObject(); } try { return JSON.parseObject(jsonStr.trim()); } catch (Throwable t) { log.error("Fail to parse data from json string" + jsonStr, t); return new JSONObject(); } }
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
parseExecutorConfigJson
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
protected void initNamespaceZkNodeIfNecessary(String namespace, CuratorRepository.CuratorFrameworkOp curatorFrameworkOp) { try { String executorsNodePath = "/" + namespace + ExecutorNodePath.get$ExecutorNodePath(); if (!curatorFrameworkOp.checkExists(executorsNodePath)) { curatorFrameworkOp.create(execut...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
initNamespaceZkNodeIfNecessary
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
private String getVersion(String namespace, CuratorRepository.CuratorFrameworkOp curatorFrameworkOp) { try { List<String> versionList = new ArrayList<>(); String executorsPath = "/" + namespace + ExecutorNodePath.getExecutorNodePath(); if (!curatorFrameworkOp.checkExists(executorsPath)) { return getVers...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
getVersion
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
private String getVersionStrFromList(List<String> versionList) { Collections.sort(versionList); StringBuilder versionSb = new StringBuilder(); versionSb.append(""); for (int i = 0; i < versionList.size(); i++) { versionSb.append(versionList.get(i)); if (i < versionList.size() - 1) { versionSb.append("...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
getVersionStrFromList
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public RegistryCenterClient connect(final String nameAndNameSpace) { final RegistryCenterClient registryCenterClient = new RegistryCenterClient(); registryCenterClient.setNameAndNamespace(nameAndNameSpace); if (nameAndNameSpace == null) { return registryCenterClient; } synchronized (getNnsLock(n...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
connect
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public RegistryCenterClient connectByNamespace(String namespace) { RegistryCenterConfiguration registryCenterConfiguration = findConfigByNamespace(namespace); if (registryCenterConfiguration == null) { return new RegistryCenterClient(); } String nns = registryCenterConfiguration.getNameAndNamespac...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
connectByNamespace
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public RegistryCenterConfiguration findConfig(String nameAndNamespace) { if (Strings.isNullOrEmpty(nameAndNamespace)) { return null; } Collection<ZkCluster> zkClusters = zkClusterMap.values(); for (ZkCluster zkCluster : zkClusters) { for (RegistryCenterConfiguration each : zkCluster.getRegCente...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
findConfig
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public RegistryCenterConfiguration findConfigByNamespace(String namespace) { if (Strings.isNullOrEmpty(namespace)) { return null; } Collection<ZkCluster> zkClusters = zkClusterMap.values(); for (ZkCluster zkCluster : zkClusters) { for (RegistryCenterConfiguration each : zkCluster.getRegCenterCo...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
findConfigByNamespace
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public List<RegistryCenterConfiguration> findConfigsByZkCluster(ZkCluster zkCluster) { List<String> namespaces = namespaceZkClusterMapping4SqlService .getAllNamespacesOfCluster(zkCluster.getZkClusterKey()); if (namespaces == null || namespaces.isEmpty()) { return Lists.newArrayList(); } List<...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
findConfigsByZkCluster
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
protected RegistryCenterConfiguration constructRegistryCenterConfiguration(ZkCluster zkCluster, String namespace) { RegistryCenterConfiguration config = new RegistryCenterConfiguration("", namespace, zkCluster.getZkAddr()); config.setZkClusterKey(zkCluster.getZkClusterKey()); config.setZkAlias(zkCluster.getZkAlia...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
constructRegistryCenterConfiguration
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public CuratorRepository.CuratorFrameworkOp connectOnly(String zkAddr, String namespace) throws SaturnJobConsoleException { CuratorFramework curatorFramework = curatorRepository.connect(zkAddr, namespace, null); if (curatorFramework != null) { return curatorRepository.newCuratorFrameworkOp(curatorF...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
connectOnly
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public void notifyRefreshRegCenter() throws SaturnJobConsoleException { SystemConfig systemConfig = new SystemConfig(); systemConfig.setProperty(SystemConfigProperties.REFRESH_REGISTRY_CENTER_UUID); systemConfig.setValue(UUID.randomUUID().toString()); systemConfigService.insertOrUpdate(systemConfig);...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
notifyRefreshRegCenter
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public RegistryCenterClient getCuratorByNameAndNamespace(String nameAndNamespace) { return registryCenterClientMap.get(nameAndNamespace); }
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
getCuratorByNameAndNamespace
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public boolean isDashboardLeader(String zkClusterKey) { DashboardLeaderHandler dashboardLeaderHandler = dashboardLeaderTreeCacheMap.get(zkClusterKey); if (dashboardLeaderHandler != null) { return dashboardLeaderHandler.isLeader(); } return false; }
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
isDashboardLeader
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public ZkCluster getZkCluster(String zkClusterKey) { return zkClusterMap.get(zkClusterKey); }
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
getZkCluster
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public Collection<ZkCluster> getZkClusterList() { return zkClusterMap.values(); }
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
getZkClusterList
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public List<ZkCluster> getOnlineZkClusterList() { List<ZkCluster> onlineClusters = Lists.newArrayList(); for (ZkCluster zkCluster : zkClusterMap.values()) { if (!zkCluster.isOffline()) { onlineClusters.add(zkCluster); } } return onlineClusters; }
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
getOnlineZkClusterList
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
private List<String> getZkClusterKeys() { Collection<ZkCluster> zkClusters = getZkClusterList(); List<String> zkClusterKeys = Lists.newArrayList(); for (ZkCluster zkCluster : zkClusters) { zkClusterKeys.add(zkCluster.getZkClusterKey()); } return zkClusterKeys; }
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
getZkClusterKeys
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public int domainCount(String zkClusterKey) { ZkCluster zkCluster = zkClusterMap.get(zkClusterKey); if (zkCluster != null) { ArrayList<RegistryCenterConfiguration> regList = zkCluster.getRegCenterConfList(); if (regList != null) { return regList.size(); } } return 0; }
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
domainCount
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public boolean namespaceIsCorrect(String namespace, CuratorFramework curatorFramework) throws SaturnJobConsoleException { if (SaturnSelfNodePath.ROOT_NAME.equals(namespace)) { return false; } try { String executorsPath = "/" + namespace + ExecutorNodePath.getExecutorNodePath(); if (curatorF...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
namespaceIsCorrect
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public List<String> getNamespaces() throws SaturnJobConsoleException { return allOnlineNamespaces; }
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
getNamespaces
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override public File exportNamespaceInfo(List<String> namespaceList) throws SaturnJobConsoleException { Set<String> targetNamespaceSet = null; if (namespaceList != null) { targetNamespaceSet = Sets.newHashSet(namespaceList); } List<RegistryCenterConfiguration> namespaceInfoList = Lists.newLinkedList(); ...
Close dashboardLeaderTreeCache, registryCenterClient, namespaceShardingListenerManager with this zkCluster
exportNamespaceInfo
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/service/impl/RegistryCenterServiceImpl.java
Apache-2.0
@Override protected Map<String, String> initialValue() { return Maps.newLinkedHashMap(); }
Context to hold the audit info. @author kfchu
initialValue
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
Apache-2.0
public static void put(String key, String value) { auditInfoHolder.get().put(key, value); }
Context to hold the audit info. @author kfchu
put
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
Apache-2.0
public static void putNamespace(String value) { auditInfoHolder.get().put("namespace", value); }
Context to hold the audit info. @author kfchu
putNamespace
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
Apache-2.0
public static void putJobName(String value) { auditInfoHolder.get().put("jobName", value); }
Context to hold the audit info. @author kfchu
putJobName
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
Apache-2.0
public static void putJobNames(List<String> value) { auditInfoHolder.get().put("jobNames", value.toString()); }
Context to hold the audit info. @author kfchu
putJobNames
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
Apache-2.0
public static void putExecutorName(String value) { auditInfoHolder.get().put("executorName", value); }
Context to hold the audit info. @author kfchu
putExecutorName
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
Apache-2.0
public static String get(String key) { return auditInfoHolder.get().get(key); }
Context to hold the audit info. @author kfchu
get
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
Apache-2.0
public static Map<String, String> currentAuditInfo() { return auditInfoHolder.get(); }
Context to hold the audit info. @author kfchu
currentAuditInfo
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/AuditInfoContext.java
Apache-2.0
public static String get$ContainerNodePath() { return "/" + $CONTAINERS_NODE_NAME; }
@deprecated useless for now @author yangjuanying
get$ContainerNodePath
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
Apache-2.0
public static String getDcosTasksNodePath() { return String.format("/%s/tasks", $CONTAINERS_NODE_NAME); }
@deprecated useless for now @author yangjuanying
getDcosTasksNodePath
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
Apache-2.0
public static String getDcosTaskIdNodePath(final String taskId) { return String.format("%s/%s", getDcosTasksNodePath(), taskId); }
@deprecated useless for now @author yangjuanying
getDcosTaskIdNodePath
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
Apache-2.0
public static String getDcosTaskConfigNodePath(final String taskId) { return String.format("%s/config", getDcosTaskIdNodePath(taskId)); }
@deprecated useless for now @author yangjuanying
getDcosTaskConfigNodePath
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
Apache-2.0
public static String getDcosTaskScaleJobsNodePath(final String taskId) { return String.format("%s/scaleJobs", getDcosTaskIdNodePath(taskId)); }
@deprecated useless for now @author yangjuanying
getDcosTaskScaleJobsNodePath
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
Apache-2.0
public static String getDcosTaskScaleJobNodePath(final String taskId, final String jobName) { return String.format("%s/scaleJobs/%s", getDcosTaskIdNodePath(taskId), jobName); }
@deprecated useless for now @author yangjuanying
getDcosTaskScaleJobNodePath
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
Apache-2.0
public static String getDcosConfigTokenNodePath() { return String.format("%s/config/token", get$ContainerNodePath()); }
@deprecated useless for now @author yangjuanying
getDcosConfigTokenNodePath
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/ContainerNodePath.java
Apache-2.0
public static boolean isValidExpression(String cronExpression) { try { new CronExpression(cronExpression);// NOSONAR } catch (ParseException pe) { return false; } return true; }
Indicates whether the specified cron expression can be parsed into a valid cron expression @param cronExpression the expression to evaluate @return a boolean indicating whether the given expression is a valid cron expression
isValidExpression
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
public static void validateExpression(String cronExpression) throws ParseException { new CronExpression(cronExpression);// NOSONAR }
Indicates whether the specified cron expression can be parsed into a valid cron expression @param cronExpression the expression to evaluate @return a boolean indicating whether the given expression is a valid cron expression
validateExpression
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
public boolean isSatisfiedBy(Date date) { Calendar testDateCal = Calendar.getInstance(getTimeZone()); testDateCal.setTime(date); testDateCal.set(Calendar.MILLISECOND, 0); Date originalDate = testDateCal.getTime(); testDateCal.add(Calendar.SECOND, -1); Date timeAfter = getTimeAfter(testDateCal.getTime()); ...
Indicates whether the given date satisfies the cron expression. Note that milliseconds are ignored, so two Dates falling on different milliseconds of the same second will always have the same result here. @param date the date to evaluate @return a boolean indicating whether the given date satisfies the cron expression
isSatisfiedBy
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
public Date getNextValidTimeAfter(Date date) { return getTimeAfter(date); }
Returns the next date/time <I>after</I> the given date/time which satisfies the cron expression. @param date the date/time at which to begin the search for the next valid date/time @return the next valid date/time
getNextValidTimeAfter
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
public Date getNextInvalidTimeAfter(Date date) { long difference = 1000; // move back to the nearest second so differences will be accurate Calendar adjustCal = Calendar.getInstance(getTimeZone()); adjustCal.setTime(date); adjustCal.set(Calendar.MILLISECOND, 0); Date lastDate = adjustCal.getTime(); Date...
Returns the next date/time <I>after</I> the given date/time which does <I>not</I> satisfy the expression @param date the date/time at which to begin the search for the next invalid date/time @return the next valid date/time
getNextInvalidTimeAfter
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
public TimeZone getTimeZone() { if (timeZone == null) { timeZone = TimeZone.getDefault(); } return timeZone; }
Returns the time zone for which this <code>CronExpression</code> will be resolved.
getTimeZone
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
public void setTimeZone(TimeZone timeZone) { this.timeZone = timeZone; }
Sets the time zone for which this <code>CronExpression</code> will be resolved.
setTimeZone
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
@Override public String toString() { return cronExpression; }
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
toString
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected void buildExpression(String expression) throws ParseException { expressionParsed = true; try { if (seconds == null) { seconds = new TreeSet<Integer>(); } if (minutes == null) { minutes = new TreeSet<Integer>(); } if (hours == null) { hours = new TreeSet<Integer>(); } if ...
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
buildExpression
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected int storeExpressionVals(int pos, String s, int type) throws ParseException { int incr = 0; int i = skipWhiteSpace(pos, s); if (i >= s.length()) { return i; } char c = s.charAt(i); if ((c >= 'A') && (c <= 'Z') && (!s.equals("L")) && (!s.equals("LW")) && (!s.matches("^L-[0-9]*[W]?"))) { Strin...
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
storeExpressionVals
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected int checkNext(int pos, String s, int val, int type) throws ParseException { int end = -1; int i = pos; if (i >= s.length()) { addToSet(val, end, -1, type); return i; } char c = s.charAt(pos); if (c == 'L') { if (type == DAY_OF_WEEK) { if (val < 1 || val > 7) { throw new Parse...
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
checkNext
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
public String getCronExpression() { return cronExpression; }
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
getCronExpression
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
public String getExpressionSummary() { StringBuilder buf = new StringBuilder(); buf.append("seconds: "); buf.append(getExpressionSetSummary(seconds)); buf.append("\n"); buf.append("minutes: "); buf.append(getExpressionSetSummary(minutes)); buf.append("\n"); buf.append("hours: "); buf.append(getExpres...
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
getExpressionSummary
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected String getExpressionSetSummary(java.util.Set<Integer> set) { if (set.contains(NO_SPEC)) { return "?"; } if (set.contains(ALL_SPEC)) { return "*"; } StringBuilder buf = new StringBuilder(); Iterator<Integer> itr = set.iterator(); boolean first = true; while (itr.hasNext()) { Integer...
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
getExpressionSetSummary
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected String getExpressionSetSummary(java.util.ArrayList<Integer> list) { if (list.contains(NO_SPEC)) { return "?"; } if (list.contains(ALL_SPEC)) { return "*"; } StringBuilder buf = new StringBuilder(); Iterator<Integer> itr = list.iterator(); boolean first = true; while (itr.hasNext()) { ...
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
getExpressionSetSummary
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected int skipWhiteSpace(int i, String s) { for (; i < s.length() && (s.charAt(i) == ' ' || s.charAt(i) == '\t'); i++) { ; } return i; }
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
skipWhiteSpace
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected int findNextWhiteSpace(int i, String s) { for (; i < s.length() && (s.charAt(i) != ' ' || s.charAt(i) != '\t'); i++) { ; } return i; }
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
findNextWhiteSpace
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected void addToSet(int val, int end, int incr, int type) throws ParseException { TreeSet<Integer> set = getSet(type); if (type == SECOND || type == MINUTE) { if ((val < 0 || val > 59 || end > 59) && (val != ALL_SPEC_INT)) { throw new ParseException("Minute and Second values must be between 0 and 59", ...
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
addToSet
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
TreeSet<Integer> getSet(int type) { switch (type) { case SECOND: return seconds; case MINUTE: return minutes; case HOUR: return hours; case DAY_OF_MONTH: return daysOfMonth; case MONTH: return months; case DAY_OF_WEEK: return daysOfWeek; case YEAR: return years; def...
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
getSet
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected ValueSet getValue(int v, String s, int i) { char c = s.charAt(i); StringBuilder s1 = new StringBuilder(String.valueOf(v)); while (c >= '0' && c <= '9') { s1.append(c); i++; if (i >= s.length()) { break; } c = s.charAt(i); } ValueSet val = new ValueSet(); val.pos = (i < s.length...
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
getValue
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected int getNumericValue(String s, int i) { int endOfVal = findNextWhiteSpace(i, s); String val = s.substring(i, endOfVal); return Integer.parseInt(val); }
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
getNumericValue
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected int getMonthNumber(String s) { Integer integer = monthMap.get(s); if (integer == null) { return -1; } return integer; }
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
getMonthNumber
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected int getDayOfWeekNumber(String s) { Integer integer = dayMap.get(s); if (integer == null) { return -1; } return integer; }
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
getDayOfWeekNumber
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
public Date getTimeAfter(Date afterTime) { // Computation is based on Gregorian year only. Calendar cl = new java.util.GregorianCalendar(getTimeZone()); // move ahead one second, since we're computing the time *after* the // given time afterTime = new Date(afterTime.getTime() + 1000); // CronTrigger does ...
Returns the string representation of the <CODE>CronExpression</CODE> @return a string representation of the <CODE>CronExpression</CODE>
getTimeAfter
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected void setCalendarHour(Calendar cal, int hour) { cal.set(java.util.Calendar.HOUR_OF_DAY, hour); if (cal.get(java.util.Calendar.HOUR_OF_DAY) != hour && hour != 24) { cal.set(java.util.Calendar.HOUR_OF_DAY, hour + 1); } }
Advance the calendar to the particular hour paying particular attention to daylight saving problems. @param cal the calendar to operate on @param hour the hour to set
setCalendarHour
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
public Date getTimeBefore(Date endTime) { // FUTURE_TODO: implement QUARTZ-423 return null; }
NOT YET IMPLEMENTED: Returns the time before the given time that the <code>CronExpression</code> matches.
getTimeBefore
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
public Date getFinalFireTime() { // FUTURE_TODO: implement QUARTZ-423 return null; }
NOT YET IMPLEMENTED: Returns the final time that the <code>CronExpression</code> will match.
getFinalFireTime
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected boolean isLeapYear(int year) { return ((year % 4 == 0 && year % 100 != 0) || (year % 400 == 0)); }
NOT YET IMPLEMENTED: Returns the final time that the <code>CronExpression</code> will match.
isLeapYear
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
protected int getLastDayOfMonth(int monthNum, int year) { switch (monthNum) { case 1: return 31; case 2: return (isLeapYear(year)) ? 29 : 28; case 3: return 31; case 4: return 30; case 5: return 31; case 6: return 30; case 7: return 31; case 8: return 31; ca...
NOT YET IMPLEMENTED: Returns the final time that the <code>CronExpression</code> will match.
getLastDayOfMonth
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
private void readObject(java.io.ObjectInputStream stream) throws java.io.IOException, ClassNotFoundException { stream.defaultReadObject(); try { buildExpression(cronExpression); } catch (Exception ignore) { } // never happens }
NOT YET IMPLEMENTED: Returns the final time that the <code>CronExpression</code> will match.
readObject
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
@Override @Deprecated public Object clone() { return new CronExpression(this); }
NOT YET IMPLEMENTED: Returns the final time that the <code>CronExpression</code> will match.
clone
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/CronExpression.java
Apache-2.0
public static Logger getAuditLogger() { return LoggerFactory.getLogger("AUDITLOG"); }
Utils for saturn console. @author kfchu
getAuditLogger
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/SaturnConsoleUtils.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/SaturnConsoleUtils.java
Apache-2.0
public static String parseMillisecond2DisplayTime(String longInStr) { return parseMillisecond2DisplayTime(longInStr, null); }
Utils for saturn console. @author kfchu
parseMillisecond2DisplayTime
java
vipshop/Saturn
saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/SaturnConsoleUtils.java
https://github.com/vipshop/Saturn/blob/master/saturn-console-api/src/main/java/com/vip/saturn/job/console/utils/SaturnConsoleUtils.java
Apache-2.0