id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
121,000
salesforce/Argus
ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/NamespaceService.java
NamespaceService.updateNamespaceMembers
public Namespace updateNamespaceMembers(BigInteger id, Set<String> users) throws IOException, TokenExpiredException { String requestUrl = RESOURCE + "/" + id.toString() + "/users"; ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.PUT, requestUrl, users); asser...
java
public Namespace updateNamespaceMembers(BigInteger id, Set<String> users) throws IOException, TokenExpiredException { String requestUrl = RESOURCE + "/" + id.toString() + "/users"; ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.PUT, requestUrl, users); asser...
[ "public", "Namespace", "updateNamespaceMembers", "(", "BigInteger", "id", ",", "Set", "<", "String", ">", "users", ")", "throws", "IOException", ",", "TokenExpiredException", "{", "String", "requestUrl", "=", "RESOURCE", "+", "\"/\"", "+", "id", ".", "toString",...
Updates a the members of a namespace. @param id The ID of the namespace to update. @param users The updated members of the namespace. @return The updated namespace. @throws IOException If the server cannot be reached. @throws TokenExpiredException If the token sent along with the request has expired
[ "Updates", "a", "the", "members", "of", "a", "namespace", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/NamespaceService.java#L132-L138
121,001
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/warden/WardenNotifier.java
WardenNotifier.sendWardenEmailToUser
protected void sendWardenEmailToUser(NotificationContext context, SubSystem subSystem) { EntityManager em = emf.get(); PrincipalUser user = getWardenUser(context.getAlert().getName()); SuspensionRecord record = SuspensionRecord.findByUserAndSubsystem(em, user, subSystem); Set<String> to ...
java
protected void sendWardenEmailToUser(NotificationContext context, SubSystem subSystem) { EntityManager em = emf.get(); PrincipalUser user = getWardenUser(context.getAlert().getName()); SuspensionRecord record = SuspensionRecord.findByUserAndSubsystem(em, user, subSystem); Set<String> to ...
[ "protected", "void", "sendWardenEmailToUser", "(", "NotificationContext", "context", ",", "SubSystem", "subSystem", ")", "{", "EntityManager", "em", "=", "emf", ".", "get", "(", ")", ";", "PrincipalUser", "user", "=", "getWardenUser", "(", "context", ".", "getAl...
Sends an email to user and admin with information on suspension and when user will be reinstated. @param context Notification context of the warden notifier @param subSystem The sub system user has been suspended from
[ "Sends", "an", "email", "to", "user", "and", "admin", "with", "information", "on", "suspension", "and", "when", "user", "will", "be", "reinstated", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/warden/WardenNotifier.java#L177-L205
121,002
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/warden/WardenNotifier.java
WardenNotifier.getWardenUser
protected PrincipalUser getWardenUser(String wardenAlertName) { assert (wardenAlertName != null) : "Warden alert name cannot be null."; int beginIndex = wardenAlertName.indexOf("-") + 1; int endIndex = wardenAlertName.lastIndexOf("-"); return PrincipalUser.findByUserName(emf.get(), war...
java
protected PrincipalUser getWardenUser(String wardenAlertName) { assert (wardenAlertName != null) : "Warden alert name cannot be null."; int beginIndex = wardenAlertName.indexOf("-") + 1; int endIndex = wardenAlertName.lastIndexOf("-"); return PrincipalUser.findByUserName(emf.get(), war...
[ "protected", "PrincipalUser", "getWardenUser", "(", "String", "wardenAlertName", ")", "{", "assert", "(", "wardenAlertName", "!=", "null", ")", ":", "\"Warden alert name cannot be null.\"", ";", "int", "beginIndex", "=", "wardenAlertName", ".", "indexOf", "(", "\"-\""...
From warden alert name, de-constructs the user for whom this warden alert is associated with. @param wardenAlertName Name of warden alert @return User associated with the warden alert
[ "From", "warden", "alert", "name", "de", "-", "constructs", "the", "user", "for", "whom", "this", "warden", "alert", "is", "associated", "with", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/warden/WardenNotifier.java#L220-L227
121,003
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PrincipalUser.java
PrincipalUser.findUniqueUserCount
public static long findUniqueUserCount(EntityManager em) { TypedQuery<Long> query = em.createNamedQuery("PrincipalUser.findUniqueUserCount", Long.class); return query.getSingleResult(); }
java
public static long findUniqueUserCount(EntityManager em) { TypedQuery<Long> query = em.createNamedQuery("PrincipalUser.findUniqueUserCount", Long.class); return query.getSingleResult(); }
[ "public", "static", "long", "findUniqueUserCount", "(", "EntityManager", "em", ")", "{", "TypedQuery", "<", "Long", ">", "query", "=", "em", ".", "createNamedQuery", "(", "\"PrincipalUser.findUniqueUserCount\"", ",", "Long", ".", "class", ")", ";", "return", "qu...
Returns the unique user count. @param em The entity manager to use. @return The unique user count.
[ "Returns", "the", "unique", "user", "count", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PrincipalUser.java#L246-L250
121,004
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PrincipalUser.java
PrincipalUser.findByUserName
public static PrincipalUser findByUserName(EntityManager em, String userName) { Class<PrincipalUser> type = PrincipalUser.class; TypedQuery<PrincipalUser> query = em.createNamedQuery("PrincipalUser.findByUserName", type); try { return query.setParameter("userName", userName).getSing...
java
public static PrincipalUser findByUserName(EntityManager em, String userName) { Class<PrincipalUser> type = PrincipalUser.class; TypedQuery<PrincipalUser> query = em.createNamedQuery("PrincipalUser.findByUserName", type); try { return query.setParameter("userName", userName).getSing...
[ "public", "static", "PrincipalUser", "findByUserName", "(", "EntityManager", "em", ",", "String", "userName", ")", "{", "Class", "<", "PrincipalUser", ">", "type", "=", "PrincipalUser", ".", "class", ";", "TypedQuery", "<", "PrincipalUser", ">", "query", "=", ...
Finds the application database user account for the provided user name. @param em The entity manager to use. @param userName The user name for which to retrieve the account information for. @return The user account or null if no account exists.
[ "Finds", "the", "application", "database", "user", "account", "for", "the", "provided", "user", "name", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PrincipalUser.java#L260-L269
121,005
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PrincipalUser.java
PrincipalUser.setEmail
public void setEmail(String email) { SystemAssert.requireArgument(email != null && !email.isEmpty(), "Email cannot be null or empty."); this.email = email; }
java
public void setEmail(String email) { SystemAssert.requireArgument(email != null && !email.isEmpty(), "Email cannot be null or empty."); this.email = email; }
[ "public", "void", "setEmail", "(", "String", "email", ")", "{", "SystemAssert", ".", "requireArgument", "(", "email", "!=", "null", "&&", "!", "email", ".", "isEmpty", "(", ")", ",", "\"Email cannot be null or empty.\"", ")", ";", "this", ".", "email", "=", ...
Updates the email address for the user. @param email The new email address.
[ "Updates", "the", "email", "address", "for", "the", "user", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PrincipalUser.java#L305-L308
121,006
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PrincipalUser.java
PrincipalUser.setUserName
public void setUserName(String userName) { SystemAssert.requireArgument(userName != null && !userName.isEmpty(), "Username cannot be null or empty."); this.userName = userName; }
java
public void setUserName(String userName) { SystemAssert.requireArgument(userName != null && !userName.isEmpty(), "Username cannot be null or empty."); this.userName = userName; }
[ "public", "void", "setUserName", "(", "String", "userName", ")", "{", "SystemAssert", ".", "requireArgument", "(", "userName", "!=", "null", "&&", "!", "userName", ".", "isEmpty", "(", ")", ",", "\"Username cannot be null or empty.\"", ")", ";", "this", ".", "...
Updates the user name for the user. @param userName The new user name.
[ "Updates", "the", "user", "name", "for", "the", "user", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PrincipalUser.java#L315-L318
121,007
salesforce/Argus
ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/AuthService.java
AuthService.login
public void login(String username, String password) throws IOException { String requestUrl = RESOURCE + "/login"; Credentials creds = new Credentials(); creds.setPassword(password); creds.setUsername(username); ArgusResponse response = getClient().executeHttpRequest(ArgusHttpCl...
java
public void login(String username, String password) throws IOException { String requestUrl = RESOURCE + "/login"; Credentials creds = new Credentials(); creds.setPassword(password); creds.setUsername(username); ArgusResponse response = getClient().executeHttpRequest(ArgusHttpCl...
[ "public", "void", "login", "(", "String", "username", ",", "String", "password", ")", "throws", "IOException", "{", "String", "requestUrl", "=", "RESOURCE", "+", "\"/login\"", ";", "Credentials", "creds", "=", "new", "Credentials", "(", ")", ";", "creds", "....
Logs into Argus. @param username The username. @param password The password. @throws IOException If the server is unavailable.
[ "Logs", "into", "Argus", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/AuthService.java#L77-L96
121,008
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/DashboardDto.java
DashboardDto.transformToDto
public static DashboardDto transformToDto(Dashboard dashboard) { if (dashboard == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } DashboardDto result = createDtoObject(DashboardDto.class, dashboard);...
java
public static DashboardDto transformToDto(Dashboard dashboard) { if (dashboard == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } DashboardDto result = createDtoObject(DashboardDto.class, dashboard);...
[ "public", "static", "DashboardDto", "transformToDto", "(", "Dashboard", "dashboard", ")", "{", "if", "(", "dashboard", "==", "null", ")", "{", "throw", "new", "WebApplicationException", "(", "\"Null entity object cannot be converted to Dto object.\"", ",", "Status", "."...
Converts dashboard entity to dashboardDto. @param dashboard The dashboard object. Cannot be null. @return DashboardDto object. @throws WebApplicationException If an error occurs.
[ "Converts", "dashboard", "entity", "to", "dashboardDto", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/DashboardDto.java#L77-L86
121,009
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/DashboardDto.java
DashboardDto.transformToDto
public static List<DashboardDto> transformToDto(List<Dashboard> dashboards) { if (dashboards == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } List<DashboardDto> result = new ArrayList<DashboardDto>...
java
public static List<DashboardDto> transformToDto(List<Dashboard> dashboards) { if (dashboards == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } List<DashboardDto> result = new ArrayList<DashboardDto>...
[ "public", "static", "List", "<", "DashboardDto", ">", "transformToDto", "(", "List", "<", "Dashboard", ">", "dashboards", ")", "{", "if", "(", "dashboards", "==", "null", ")", "{", "throw", "new", "WebApplicationException", "(", "\"Null entity object cannot be con...
Converts list of dashboard entity objects to list of dashboardDto objects. @param dashboards List of dashboard entities. Cannot be null. @return List of dashboard objects. @throws WebApplicationException If an error occurs.
[ "Converts", "list", "of", "dashboard", "entity", "objects", "to", "list", "of", "dashboardDto", "objects", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/DashboardDto.java#L97-L108
121,010
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/DashboardDto.java
DashboardDto.setTemplateVars
public void setTemplateVars(List<TemplateVar> templateVars) { this.templateVars.clear(); if(templateVars != null && !templateVars.isEmpty()) { this.templateVars.addAll(templateVars); } }
java
public void setTemplateVars(List<TemplateVar> templateVars) { this.templateVars.clear(); if(templateVars != null && !templateVars.isEmpty()) { this.templateVars.addAll(templateVars); } }
[ "public", "void", "setTemplateVars", "(", "List", "<", "TemplateVar", ">", "templateVars", ")", "{", "this", ".", "templateVars", ".", "clear", "(", ")", ";", "if", "(", "templateVars", "!=", "null", "&&", "!", "templateVars", ".", "isEmpty", "(", ")", "...
Sets the template variables used in this dashboard. @param templateVars A list of template variables. If the list is null or empty then existing templateVars are cleared.
[ "Sets", "the", "template", "variables", "used", "in", "this", "dashboard", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/DashboardDto.java#L252-L257
121,011
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/EndpointHelpDto.java
EndpointHelpDto.fromResourceClass
public static EndpointHelpDto fromResourceClass(Class<? extends AbstractResource> resourceClass) { Path path = resourceClass.getAnnotation(Path.class); Description description = resourceClass.getAnnotation(Description.class); if (path != null && description != null) { EndpointHelpDt...
java
public static EndpointHelpDto fromResourceClass(Class<? extends AbstractResource> resourceClass) { Path path = resourceClass.getAnnotation(Path.class); Description description = resourceClass.getAnnotation(Description.class); if (path != null && description != null) { EndpointHelpDt...
[ "public", "static", "EndpointHelpDto", "fromResourceClass", "(", "Class", "<", "?", "extends", "AbstractResource", ">", "resourceClass", ")", "{", "Path", "path", "=", "resourceClass", ".", "getAnnotation", "(", "Path", ".", "class", ")", ";", "Description", "de...
Creates an endpoint help DTO from a resource class. @param resourceClass The resource class. @return The endpoint help DTO.
[ "Creates", "an", "endpoint", "help", "DTO", "from", "a", "resource", "class", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/EndpointHelpDto.java#L59-L72
121,012
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/JWTUtils.java
JWTUtils.getUsername
public static String getUsername(String token) { String accessTokenPayload = token.substring(token.indexOf(".") + 1, token.lastIndexOf(".") ); byte[] decoded = Base64.getMimeDecoder().decode(accessTokenPayload); String output = new String(decoded); Map<String,Object> myMap = new HashMap<String, Object>(); Str...
java
public static String getUsername(String token) { String accessTokenPayload = token.substring(token.indexOf(".") + 1, token.lastIndexOf(".") ); byte[] decoded = Base64.getMimeDecoder().decode(accessTokenPayload); String output = new String(decoded); Map<String,Object> myMap = new HashMap<String, Object>(); Str...
[ "public", "static", "String", "getUsername", "(", "String", "token", ")", "{", "String", "accessTokenPayload", "=", "token", ".", "substring", "(", "token", ".", "indexOf", "(", "\".\"", ")", "+", "1", ",", "token", ".", "lastIndexOf", "(", "\".\"", ")", ...
Username from a given JWT Token @param token JWT Token @return Username from JWT Token.
[ "Username", "from", "a", "given", "JWT", "Token" ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/resources/JWTUtils.java#L130-L147
121,013
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/schedule/QueueBasedDistributedSchedulingService.java
QueueBasedDistributedSchedulingService._setServiceEnabled
@Transactional protected void _setServiceEnabled(boolean enabled) { synchronized (_serviceManagementRecordService) { ServiceManagementRecord record = _serviceManagementRecordService.findServiceManagementRecord(Service.SCHEDULING); if (record == null) { record = new S...
java
@Transactional protected void _setServiceEnabled(boolean enabled) { synchronized (_serviceManagementRecordService) { ServiceManagementRecord record = _serviceManagementRecordService.findServiceManagementRecord(Service.SCHEDULING); if (record == null) { record = new S...
[ "@", "Transactional", "protected", "void", "_setServiceEnabled", "(", "boolean", "enabled", ")", "{", "synchronized", "(", "_serviceManagementRecordService", ")", "{", "ServiceManagementRecord", "record", "=", "_serviceManagementRecordService", ".", "findServiceManagementReco...
Enables the scheduling service. @param enabled True to enable, false to disable.
[ "Enables", "the", "scheduling", "service", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/schedule/QueueBasedDistributedSchedulingService.java#L181-L192
121,014
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/PrincipalUserDto.java
PrincipalUserDto.transformToDto
public static PrincipalUserDto transformToDto(PrincipalUser user) { if (user == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } PrincipalUserDto result = createDtoObject(PrincipalUserDto.class, user)...
java
public static PrincipalUserDto transformToDto(PrincipalUser user) { if (user == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } PrincipalUserDto result = createDtoObject(PrincipalUserDto.class, user)...
[ "public", "static", "PrincipalUserDto", "transformToDto", "(", "PrincipalUser", "user", ")", "{", "if", "(", "user", "==", "null", ")", "{", "throw", "new", "WebApplicationException", "(", "\"Null entity object cannot be converted to Dto object.\"", ",", "Status", ".", ...
Converts a user entity to DTO. @param user The entity to convert. @return The DTO. @throws WebApplicationException If an error occurs.
[ "Converts", "a", "user", "entity", "to", "DTO", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/PrincipalUserDto.java#L74-L85
121,015
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/MetricSchemaRecord.java
MetricSchemaRecord.getStringValueForType
@Nullable public String getStringValueForType(SchemaService.RecordType type) { switch (type) { case NAMESPACE: return getNamespace(); case SCOPE: return getScope(); case METRIC: return getMetric(); case TAGK: ...
java
@Nullable public String getStringValueForType(SchemaService.RecordType type) { switch (type) { case NAMESPACE: return getNamespace(); case SCOPE: return getScope(); case METRIC: return getMetric(); case TAGK: ...
[ "@", "Nullable", "public", "String", "getStringValueForType", "(", "SchemaService", ".", "RecordType", "type", ")", "{", "switch", "(", "type", ")", "{", "case", "NAMESPACE", ":", "return", "getNamespace", "(", ")", ";", "case", "SCOPE", ":", "return", "getS...
consolidate this method to where it belongs without fixing its legacy expectation that all members are of string type. @param type which member @return String representation of the member or null if it's not set
[ "consolidate", "this", "method", "to", "where", "it", "belongs", "without", "fixing", "its", "legacy", "expectation", "that", "all", "members", "are", "of", "string", "type", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/MetricSchemaRecord.java#L349-L367
121,016
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/schema/AsyncHbaseSchemaService.java
AsyncHbaseSchemaService._canSkipWhileScanning
private boolean _canSkipWhileScanning(MetricSchemaRecordQuery query, RecordType type) { if( (RecordType.METRIC.equals(type) || RecordType.SCOPE.equals(type)) && !SchemaService.containsFilter(query.getTagKey()) && !SchemaService.containsFilter(query.getTagValue()) && !SchemaService.containsFilter(query.g...
java
private boolean _canSkipWhileScanning(MetricSchemaRecordQuery query, RecordType type) { if( (RecordType.METRIC.equals(type) || RecordType.SCOPE.equals(type)) && !SchemaService.containsFilter(query.getTagKey()) && !SchemaService.containsFilter(query.getTagValue()) && !SchemaService.containsFilter(query.g...
[ "private", "boolean", "_canSkipWhileScanning", "(", "MetricSchemaRecordQuery", "query", ",", "RecordType", "type", ")", "{", "if", "(", "(", "RecordType", ".", "METRIC", ".", "equals", "(", "type", ")", "||", "RecordType", ".", "SCOPE", ".", "equals", "(", "...
Check if we can perform a faster scan. We can only perform a faster scan when we are trying to discover scopes or metrics without having information on any other fields.
[ "Check", "if", "we", "can", "perform", "a", "faster", "scan", ".", "We", "can", "only", "perform", "a", "faster", "scan", "when", "we", "are", "trying", "to", "discover", "scopes", "or", "metrics", "without", "having", "information", "on", "any", "other", ...
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/schema/AsyncHbaseSchemaService.java#L449-L468
121,017
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/schema/AsyncHbaseSchemaService.java
AsyncHbaseSchemaService._constructScanMetadata
private ScanMetadata _constructScanMetadata(MetricSchemaRecordQuery query) { ScanMetadata metadata = new ScanMetadata(); char[] scopeTableRowKey = _constructRowKey(query.getNamespace(), query.getScope(), query.getMetric(), query.getTagKey(), query.getTagValue(), SCOPE_SCHEMA_TABLENAME).toCha...
java
private ScanMetadata _constructScanMetadata(MetricSchemaRecordQuery query) { ScanMetadata metadata = new ScanMetadata(); char[] scopeTableRowKey = _constructRowKey(query.getNamespace(), query.getScope(), query.getMetric(), query.getTagKey(), query.getTagValue(), SCOPE_SCHEMA_TABLENAME).toCha...
[ "private", "ScanMetadata", "_constructScanMetadata", "(", "MetricSchemaRecordQuery", "query", ")", "{", "ScanMetadata", "metadata", "=", "new", "ScanMetadata", "(", ")", ";", "char", "[", "]", "scopeTableRowKey", "=", "_constructRowKey", "(", "query", ".", "getNames...
Construct scan metadata depending on the query. This includes determining the table to query and the start and stop rows for the scan. <p>For e.g., if scope == "system.chi*" and metric = "app_runtime" then the 2 row keys will be,</p> <p>scopeRowKey = system.chi*:app_runtime:tagk:tagv:namespace metricRowKey = app_runt...
[ "Construct", "scan", "metadata", "depending", "on", "the", "query", ".", "This", "includes", "determining", "the", "table", "to", "query", "and", "the", "start", "and", "stop", "rows", "for", "the", "scan", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/schema/AsyncHbaseSchemaService.java#L699-L766
121,018
salesforce/Argus
ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/DiscoveryService.java
DiscoveryService.getMatchingRecords
public List<MetricSchemaRecord> getMatchingRecords(String namespaceRegex, String scopeRegex, String metricRegex, String tagKeyRegex, String tagValueRegex, int limit) throws IOException, TokenExpiredException { StringBuilder urlBuilder = _buildBaseUrl(namespaceRegex, scopeRegex, metricRegex, tagKeyRegex,...
java
public List<MetricSchemaRecord> getMatchingRecords(String namespaceRegex, String scopeRegex, String metricRegex, String tagKeyRegex, String tagValueRegex, int limit) throws IOException, TokenExpiredException { StringBuilder urlBuilder = _buildBaseUrl(namespaceRegex, scopeRegex, metricRegex, tagKeyRegex,...
[ "public", "List", "<", "MetricSchemaRecord", ">", "getMatchingRecords", "(", "String", "namespaceRegex", ",", "String", "scopeRegex", ",", "String", "metricRegex", ",", "String", "tagKeyRegex", ",", "String", "tagValueRegex", ",", "int", "limit", ")", "throws", "I...
Returns the schema records matching the specified criteria. At least one field matching expression must be supplied. @param namespaceRegex The regular expression on which to match the name space field. May be null. @param scopeRegex The regular expression on which to match the scope field. May be null. @para...
[ "Returns", "the", "schema", "records", "matching", "the", "specified", "criteria", ".", "At", "least", "one", "field", "matching", "expression", "must", "be", "supplied", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/DiscoveryService.java#L95-L103
121,019
salesforce/Argus
ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/DiscoveryService.java
DiscoveryService.getMatchingRecordFields
public List<String> getMatchingRecordFields(String namespaceRegex, String scopeRegex, String metricRegex, String tagKeyRegex, String tagValueRegex, FieldSelector type, int limit) throws IOException, TokenExpiredException { StringBuilder urlBuilder = _buildBaseUrl(namespaceRegex, scopeRegex, metricRegex,...
java
public List<String> getMatchingRecordFields(String namespaceRegex, String scopeRegex, String metricRegex, String tagKeyRegex, String tagValueRegex, FieldSelector type, int limit) throws IOException, TokenExpiredException { StringBuilder urlBuilder = _buildBaseUrl(namespaceRegex, scopeRegex, metricRegex,...
[ "public", "List", "<", "String", ">", "getMatchingRecordFields", "(", "String", "namespaceRegex", ",", "String", "scopeRegex", ",", "String", "metricRegex", ",", "String", "tagKeyRegex", ",", "String", "tagValueRegex", ",", "FieldSelector", "type", ",", "int", "li...
Returns the schema record fields values matching the specified criteria. At least one field matching expression must be supplied. @param namespaceRegex The regular expression on which to match the name space field. May be null. @param scopeRegex The regular expression on which to match the scope field. May b...
[ "Returns", "the", "schema", "record", "fields", "values", "matching", "the", "specified", "criteria", ".", "At", "least", "one", "field", "matching", "expression", "must", "be", "supplied", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/DiscoveryService.java#L121-L132
121,020
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/util/zookeeper/ClientNode.java
ClientNode.calculateAllNodesResult
public ClientsResult calculateAllNodesResult() { final List<String> childNodePaths = getChildren(electionRootPath, false); _logger.info("Total peers = {} ", childNodePaths.size()); Collections.sort(childNodePaths); int index = childNodePaths.indexOf(clientNodePath.substring(clientNodePath.lastIndexOf('/') + 1)...
java
public ClientsResult calculateAllNodesResult() { final List<String> childNodePaths = getChildren(electionRootPath, false); _logger.info("Total peers = {} ", childNodePaths.size()); Collections.sort(childNodePaths); int index = childNodePaths.indexOf(clientNodePath.substring(clientNodePath.lastIndexOf('/') + 1)...
[ "public", "ClientsResult", "calculateAllNodesResult", "(", ")", "{", "final", "List", "<", "String", ">", "childNodePaths", "=", "getChildren", "(", "electionRootPath", ",", "false", ")", ";", "_logger", ".", "info", "(", "\"Total peers = {} \"", ",", "childNodePa...
Gets node index and its peer count @return ClientsResult object with info
[ "Gets", "node", "index", "and", "its", "peer", "count" ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/zookeeper/ClientNode.java#L124-L131
121,021
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/util/zookeeper/ClientNode.java
ClientNode.createNode
public String createNode(final String path, final boolean watch, final boolean ephimeral) { String createdNodePath = null; try { final Stat nodeStat = zooKeeper.exists(path, watch); if(nodeStat == null) { createdNodePath = zooKeeper.create(path, new byte[0], Ids.OPEN_ACL_UNSAFE, (ephimeral ? CreateMod...
java
public String createNode(final String path, final boolean watch, final boolean ephimeral) { String createdNodePath = null; try { final Stat nodeStat = zooKeeper.exists(path, watch); if(nodeStat == null) { createdNodePath = zooKeeper.create(path, new byte[0], Ids.OPEN_ACL_UNSAFE, (ephimeral ? CreateMod...
[ "public", "String", "createNode", "(", "final", "String", "path", ",", "final", "boolean", "watch", ",", "final", "boolean", "ephimeral", ")", "{", "String", "createdNodePath", "=", "null", ";", "try", "{", "final", "Stat", "nodeStat", "=", "zooKeeper", ".",...
Create a zookeeper node @param path The path of znode to create @param watch Whether to watch this node or not @param ephimeral Create ephemeral or permanent node @return The created node path
[ "Create", "a", "zookeeper", "node" ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/zookeeper/ClientNode.java#L141-L158
121,022
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/util/zookeeper/ClientNode.java
ClientNode.getChildren
public List<String> getChildren(final String path, final boolean watch) { List<String> childNodes = null; try { childNodes = zooKeeper.getChildren(path, watch); } catch (KeeperException | InterruptedException e) { throw new IllegalStateException(e); } return childNodes; }
java
public List<String> getChildren(final String path, final boolean watch) { List<String> childNodes = null; try { childNodes = zooKeeper.getChildren(path, watch); } catch (KeeperException | InterruptedException e) { throw new IllegalStateException(e); } return childNodes; }
[ "public", "List", "<", "String", ">", "getChildren", "(", "final", "String", "path", ",", "final", "boolean", "watch", ")", "{", "List", "<", "String", ">", "childNodes", "=", "null", ";", "try", "{", "childNodes", "=", "zooKeeper", ".", "getChildren", "...
Gets list of children for a znode @param path The path of the znode @param watch Whether to watch this node or not @return List of children nodes of znode
[ "Gets", "list", "of", "children", "for", "a", "znode" ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/zookeeper/ClientNode.java#L167-L177
121,023
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Namespace.java
Namespace.findByQualifier
public static Namespace findByQualifier(EntityManager em, String qualifier) { SystemAssert.requireArgument(em != null, "EntityManager cannot be null."); SystemAssert.requireArgument(qualifier != null && !qualifier.isEmpty(), "Namespace qualifier cannot be null or empty."); TypedQuery<Namespace>...
java
public static Namespace findByQualifier(EntityManager em, String qualifier) { SystemAssert.requireArgument(em != null, "EntityManager cannot be null."); SystemAssert.requireArgument(qualifier != null && !qualifier.isEmpty(), "Namespace qualifier cannot be null or empty."); TypedQuery<Namespace>...
[ "public", "static", "Namespace", "findByQualifier", "(", "EntityManager", "em", ",", "String", "qualifier", ")", "{", "SystemAssert", ".", "requireArgument", "(", "em", "!=", "null", ",", "\"EntityManager cannot be null.\"", ")", ";", "SystemAssert", ".", "requireAr...
Returns a namespace entity using the provided namespace qualifier. @param em The entity manager. Cannot be null. @param qualifier The qualifier. Cannot be null or empty. @return The namespace or null if no corresponding namespace is found.
[ "Returns", "a", "namespace", "entity", "using", "the", "provided", "namespace", "qualifier", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Namespace.java#L137-L148
121,024
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Namespace.java
Namespace.findByOwner
public static List<Namespace> findByOwner(EntityManager em, PrincipalUser owner) { SystemAssert.requireArgument(em != null, "EntityManager cannot be null."); SystemAssert.requireArgument(owner != null, "Owner cannot be null or empty."); TypedQuery<Namespace> query = em.createNamedQuery("Namespa...
java
public static List<Namespace> findByOwner(EntityManager em, PrincipalUser owner) { SystemAssert.requireArgument(em != null, "EntityManager cannot be null."); SystemAssert.requireArgument(owner != null, "Owner cannot be null or empty."); TypedQuery<Namespace> query = em.createNamedQuery("Namespa...
[ "public", "static", "List", "<", "Namespace", ">", "findByOwner", "(", "EntityManager", "em", ",", "PrincipalUser", "owner", ")", "{", "SystemAssert", ".", "requireArgument", "(", "em", "!=", "null", ",", "\"EntityManager cannot be null.\"", ")", ";", "SystemAsser...
Finds all namespaces for a given owner. @param em The entity manager to use. Cannot be null. @param owner The owner for which to retrieve dashboards. Cannot be null. @return The dashboards for the owner. Will never be null, but may be empty.
[ "Finds", "all", "namespaces", "for", "a", "given", "owner", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Namespace.java#L158-L169
121,025
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Namespace.java
Namespace.setQualifier
public void setQualifier(String qualifier) { SystemAssert.requireArgument(qualifier != null && !qualifier.isEmpty(), "Namespace qualifier cannot be null or empty."); this.qualifier = qualifier; }
java
public void setQualifier(String qualifier) { SystemAssert.requireArgument(qualifier != null && !qualifier.isEmpty(), "Namespace qualifier cannot be null or empty."); this.qualifier = qualifier; }
[ "public", "void", "setQualifier", "(", "String", "qualifier", ")", "{", "SystemAssert", ".", "requireArgument", "(", "qualifier", "!=", "null", "&&", "!", "qualifier", ".", "isEmpty", "(", ")", ",", "\"Namespace qualifier cannot be null or empty.\"", ")", ";", "th...
Sets the namespace qualifier. @param qualifier The namespace qualifier. Cannot be null or empty.
[ "Sets", "the", "namespace", "qualifier", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Namespace.java#L187-L190
121,026
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Namespace.java
Namespace.addUser
public void addUser(PrincipalUser user) { SystemAssert.requireArgument(user != null, "Null user can not be added."); users.add(user); }
java
public void addUser(PrincipalUser user) { SystemAssert.requireArgument(user != null, "Null user can not be added."); users.add(user); }
[ "public", "void", "addUser", "(", "PrincipalUser", "user", ")", "{", "SystemAssert", ".", "requireArgument", "(", "user", "!=", "null", ",", "\"Null user can not be added.\"", ")", ";", "users", ".", "add", "(", "user", ")", ";", "}" ]
Adds an authorized user of the namespace. @param user The authorized user. Cannot be null.
[ "Adds", "an", "authorized", "user", "of", "the", "namespace", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Namespace.java#L220-L223
121,027
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/History.java
History.findHistoryByJob
public static List<History> findHistoryByJob(EntityManager em, BigInteger jobId, int limit) { requireArgument(em != null, "Entity manager cannot be null."); requireArgument(jobId != null, "The jobId cannot be null."); requireArgument(limit > 0, "Limit must be a positive integer."); Type...
java
public static List<History> findHistoryByJob(EntityManager em, BigInteger jobId, int limit) { requireArgument(em != null, "Entity manager cannot be null."); requireArgument(jobId != null, "The jobId cannot be null."); requireArgument(limit > 0, "Limit must be a positive integer."); Type...
[ "public", "static", "List", "<", "History", ">", "findHistoryByJob", "(", "EntityManager", "em", ",", "BigInteger", "jobId", ",", "int", "limit", ")", "{", "requireArgument", "(", "em", "!=", "null", ",", "\"Entity manager cannot be null.\"", ")", ";", "requireA...
Finds all history records for the given job. @param em Entity manager. Cannot be null. @param jobId The job for which the history will be returned. Cannot be null. @param limit The number of results to return. @return History belongs to given entity.
[ "Finds", "all", "history", "records", "for", "the", "given", "job", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/History.java#L187-L201
121,028
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/History.java
History.deleteExpiredHistory
public static int deleteExpiredHistory(EntityManager em) { requireArgument(em != null, "Entity manager cannot be null."); Query query = em.createNamedQuery("History.cullExpired"); query.setParameter("expiryTime", System.currentTimeMillis() - (2 * MILLIS_PER_WEEK)); return query.execute...
java
public static int deleteExpiredHistory(EntityManager em) { requireArgument(em != null, "Entity manager cannot be null."); Query query = em.createNamedQuery("History.cullExpired"); query.setParameter("expiryTime", System.currentTimeMillis() - (2 * MILLIS_PER_WEEK)); return query.execute...
[ "public", "static", "int", "deleteExpiredHistory", "(", "EntityManager", "em", ")", "{", "requireArgument", "(", "em", "!=", "null", ",", "\"Entity manager cannot be null.\"", ")", ";", "Query", "query", "=", "em", ".", "createNamedQuery", "(", "\"History.cullExpire...
Deletes the old job history. @param em Entity manager. Cannot be null. @return no. of job history records deleted.
[ "Deletes", "the", "old", "job", "history", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/History.java#L237-L244
121,029
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/History.java
History.setMessage
public void setMessage(String message) { requireArgument(message != null && !message.isEmpty(), "Message cannot be null or empty."); this.message = message; }
java
public void setMessage(String message) { requireArgument(message != null && !message.isEmpty(), "Message cannot be null or empty."); this.message = message; }
[ "public", "void", "setMessage", "(", "String", "message", ")", "{", "requireArgument", "(", "message", "!=", "null", "&&", "!", "message", ".", "isEmpty", "(", ")", ",", "\"Message cannot be null or empty.\"", ")", ";", "this", ".", "message", "=", "message", ...
Sets the exception message. @param message The exception message. Cannot be null or empty.
[ "Sets", "the", "exception", "message", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/History.java#L322-L325
121,030
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/History.java
History.setHostName
public void setHostName(String hostName) { requireArgument(hostName != null && !hostName.isEmpty(), "Hostname cannot be null or empty."); this.hostName = hostName; }
java
public void setHostName(String hostName) { requireArgument(hostName != null && !hostName.isEmpty(), "Hostname cannot be null or empty."); this.hostName = hostName; }
[ "public", "void", "setHostName", "(", "String", "hostName", ")", "{", "requireArgument", "(", "hostName", "!=", "null", "&&", "!", "hostName", ".", "isEmpty", "(", ")", ",", "\"Hostname cannot be null or empty.\"", ")", ";", "this", ".", "hostName", "=", "host...
Sets the host name. @param hostName The host name. Cannot be null or empty.
[ "Sets", "the", "host", "name", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/History.java#L341-L344
121,031
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AnnotationDto.java
AnnotationDto.transformToDto
public static AnnotationDto transformToDto(Annotation annotation) { if (annotation == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } AnnotationDto result = createDtoObject(AnnotationDto.class, annot...
java
public static AnnotationDto transformToDto(Annotation annotation) { if (annotation == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } AnnotationDto result = createDtoObject(AnnotationDto.class, annot...
[ "public", "static", "AnnotationDto", "transformToDto", "(", "Annotation", "annotation", ")", "{", "if", "(", "annotation", "==", "null", ")", "{", "throw", "new", "WebApplicationException", "(", "\"Null entity object cannot be converted to Dto object.\"", ",", "Status", ...
Converts annotation entity to DTO. @param annotation The annotation entity. Cannot be null. @return The annotation DTO. @throws WebApplicationException If an error occurs.
[ "Converts", "annotation", "entity", "to", "DTO", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AnnotationDto.java#L68-L76
121,032
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AlertDto.java
AlertDto.transformToDto
public static AlertDto transformToDto(Alert alert) { if (alert == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } AlertDto result = createDtoObject(AlertDto.class, alert); result.setOwnerNam...
java
public static AlertDto transformToDto(Alert alert) { if (alert == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } AlertDto result = createDtoObject(AlertDto.class, alert); result.setOwnerNam...
[ "public", "static", "AlertDto", "transformToDto", "(", "Alert", "alert", ")", "{", "if", "(", "alert", "==", "null", ")", "{", "throw", "new", "WebApplicationException", "(", "\"Null entity object cannot be converted to Dto object.\"", ",", "Status", ".", "INTERNAL_SE...
Converts alert entity to alertDto. @param alert The alert object. Cannot be null. @return AlertDto object. @throws WebApplicationException If an error occurs.
[ "Converts", "alert", "entity", "to", "alertDto", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AlertDto.java#L77-L92
121,033
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Audit.java
Audit.findByHostName
public static List<Audit> findByHostName(EntityManager em, String hostName) { requireArgument(em != null, "Entity manager cannot be null."); requireArgument(hostName != null && !hostName.isEmpty(), "Host name cannot be null or empty."); TypedQuery<Audit> query = em.createNamedQuery("Audit.findB...
java
public static List<Audit> findByHostName(EntityManager em, String hostName) { requireArgument(em != null, "Entity manager cannot be null."); requireArgument(hostName != null && !hostName.isEmpty(), "Host name cannot be null or empty."); TypedQuery<Audit> query = em.createNamedQuery("Audit.findB...
[ "public", "static", "List", "<", "Audit", ">", "findByHostName", "(", "EntityManager", "em", ",", "String", "hostName", ")", "{", "requireArgument", "(", "em", "!=", "null", ",", "\"Entity manager cannot be null.\"", ")", ";", "requireArgument", "(", "hostName", ...
Finds all alerts created by given host name. @param em The entity manager. Cannot be null. @param hostName The name of the host. . Cannot be null or empty. @return List of audits created by given host name.
[ "Finds", "all", "alerts", "created", "by", "given", "host", "name", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Audit.java#L169-L181
121,034
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Audit.java
Audit.findByEntityHostnameMessage
@SuppressWarnings("unchecked") public static List<Audit> findByEntityHostnameMessage(EntityManager em, JPAEntity entity, String hostName, String message) { boolean isAndrequired = false; StringBuilder queryString = new StringBuilder("SELECT a FROM Audit a "); if (entity != null) { ...
java
@SuppressWarnings("unchecked") public static List<Audit> findByEntityHostnameMessage(EntityManager em, JPAEntity entity, String hostName, String message) { boolean isAndrequired = false; StringBuilder queryString = new StringBuilder("SELECT a FROM Audit a "); if (entity != null) { ...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "static", "List", "<", "Audit", ">", "findByEntityHostnameMessage", "(", "EntityManager", "em", ",", "JPAEntity", "entity", ",", "String", "hostName", ",", "String", "message", ")", "{", "boolean", "i...
Finds audit history based on the entity, host name and message fragment. @param em The entity manager. Cannot be null. @param entity The entity. If null, result will not be filtered by entity. @param hostName The host name. If null, result will not be filtered by host name. @param message The mess...
[ "Finds", "audit", "history", "based", "on", "the", "entity", "host", "name", "and", "message", "fragment", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Audit.java#L243-L283
121,035
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Audit.java
Audit.findByMessage
public static List<Audit> findByMessage(EntityManager em, String message) { requireArgument(em != null, "Entity manager cannot be null."); requireArgument(message != null && !message.isEmpty(), "Message cannot be null or empty."); TypedQuery<Audit> query = em.createNamedQuery("Audit.findByMessa...
java
public static List<Audit> findByMessage(EntityManager em, String message) { requireArgument(em != null, "Entity manager cannot be null."); requireArgument(message != null && !message.isEmpty(), "Message cannot be null or empty."); TypedQuery<Audit> query = em.createNamedQuery("Audit.findByMessa...
[ "public", "static", "List", "<", "Audit", ">", "findByMessage", "(", "EntityManager", "em", ",", "String", "message", ")", "{", "requireArgument", "(", "em", "!=", "null", ",", "\"Entity manager cannot be null.\"", ")", ";", "requireArgument", "(", "message", "!...
Finds audits by exception message. @param em The entity manager. Cannot be null. @param message The exception/error message. @return All audits whose error message matches with given error message.
[ "Finds", "audits", "by", "exception", "message", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Audit.java#L293-L305
121,036
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Dashboard.java
Dashboard.findByNameAndOwner
public static Dashboard findByNameAndOwner(EntityManager em, String dashboardName, PrincipalUser owner) { TypedQuery<Dashboard> query = em.createNamedQuery("Dashboard.findByNameAndOwner", Dashboard.class); try { query.setParameter("name", dashboardName); query.setParameter("owne...
java
public static Dashboard findByNameAndOwner(EntityManager em, String dashboardName, PrincipalUser owner) { TypedQuery<Dashboard> query = em.createNamedQuery("Dashboard.findByNameAndOwner", Dashboard.class); try { query.setParameter("name", dashboardName); query.setParameter("owne...
[ "public", "static", "Dashboard", "findByNameAndOwner", "(", "EntityManager", "em", ",", "String", "dashboardName", ",", "PrincipalUser", "owner", ")", "{", "TypedQuery", "<", "Dashboard", ">", "query", "=", "em", ".", "createNamedQuery", "(", "\"Dashboard.findByName...
Finds Dashboard in the database with the specified dashboard name and owned by the specified owner. @param em The entity manager to use. @param dashboardName The name of the dashboard to retrieve. Cannot be null or empty. @param owner The owner of the dashboard. Cannot be null. @return Th...
[ "Finds", "Dashboard", "in", "the", "database", "with", "the", "specified", "dashboard", "name", "and", "owned", "by", "the", "specified", "owner", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Dashboard.java#L176-L186
121,037
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Dashboard.java
Dashboard.findSharedDashboards
public static List<Dashboard> findSharedDashboards(EntityManager em, PrincipalUser owner, Integer limit, String version) { requireArgument(em != null, "Entity manager can not be null."); TypedQuery<Dashboard> query; if(owner == null){ if (version==null) { query = em.createNamedQuery("Dashboard.g...
java
public static List<Dashboard> findSharedDashboards(EntityManager em, PrincipalUser owner, Integer limit, String version) { requireArgument(em != null, "Entity manager can not be null."); TypedQuery<Dashboard> query; if(owner == null){ if (version==null) { query = em.createNamedQuery("Dashboard.g...
[ "public", "static", "List", "<", "Dashboard", ">", "findSharedDashboards", "(", "EntityManager", "em", ",", "PrincipalUser", "owner", ",", "Integer", "limit", ",", "String", "version", ")", "{", "requireArgument", "(", "em", "!=", "null", ",", "\"Entity manager ...
Finds the list of dashboards that are marked as globally shared. @param em The entity manager to use. @param owner The owner of shared dashboards to filter on @param limit The maximum number of rows to return. @param version The version of the dashboard to retrieve. It is either null or not empty ...
[ "Finds", "the", "list", "of", "dashboards", "that", "are", "marked", "as", "globally", "shared", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Dashboard.java#L198-L234
121,038
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Dashboard.java
Dashboard.findSharedDashboardsMeta
public static List<Dashboard> findSharedDashboardsMeta(EntityManager em, PrincipalUser owner, Integer limit, String version) { requireArgument(em != null, "Entity manager can not be null."); try { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<Tuple> cq = cb.createTupleQue...
java
public static List<Dashboard> findSharedDashboardsMeta(EntityManager em, PrincipalUser owner, Integer limit, String version) { requireArgument(em != null, "Entity manager can not be null."); try { CriteriaBuilder cb = em.getCriteriaBuilder(); CriteriaQuery<Tuple> cq = cb.createTupleQue...
[ "public", "static", "List", "<", "Dashboard", ">", "findSharedDashboardsMeta", "(", "EntityManager", "em", ",", "PrincipalUser", "owner", ",", "Integer", "limit", ",", "String", "version", ")", "{", "requireArgument", "(", "em", "!=", "null", ",", "\"Entity mana...
Gets all meta information of shared dashboards with filtering. @param em The entity manager to use. @param owner The owner of shared dashboards to filter on @param limit The maximum number of rows to return. @param version The version of the dashboard to retrieve. It is either null or not empty @...
[ "Gets", "all", "meta", "information", "of", "shared", "dashboards", "with", "filtering", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Dashboard.java#L246-L270
121,039
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Dashboard.java
Dashboard.findDashboards
public static List<Dashboard> findDashboards(EntityManager em, Integer limit, String version) { requireArgument(em != null, "Entity manager can not be null."); TypedQuery<Dashboard> query; if(version==null) { query= em.createNamedQuery("Dashboard.getDashboards", Dashboard.class); ...
java
public static List<Dashboard> findDashboards(EntityManager em, Integer limit, String version) { requireArgument(em != null, "Entity manager can not be null."); TypedQuery<Dashboard> query; if(version==null) { query= em.createNamedQuery("Dashboard.getDashboards", Dashboard.class); ...
[ "public", "static", "List", "<", "Dashboard", ">", "findDashboards", "(", "EntityManager", "em", ",", "Integer", "limit", ",", "String", "version", ")", "{", "requireArgument", "(", "em", "!=", "null", ",", "\"Entity manager can not be null.\"", ")", ";", "Typed...
Returns dashboards ordered by owner and dashboard name. @param em The entity manager to use. Cannot be null. @param limit The maximum number of dashboards to retrieve. If null, all records will be returned, otherwise must be a positive non-zero number. @param version The version of the dashboard to retrie...
[ "Returns", "dashboards", "ordered", "by", "owner", "and", "dashboard", "name", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Dashboard.java#L331-L351
121,040
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Dashboard.java
Dashboard.setName
public void setName(String name) { SystemAssert.requireArgument(name != null && !name.isEmpty(), "Dashboard Name cannot be null or empty"); this.name = name; }
java
public void setName(String name) { SystemAssert.requireArgument(name != null && !name.isEmpty(), "Dashboard Name cannot be null or empty"); this.name = name; }
[ "public", "void", "setName", "(", "String", "name", ")", "{", "SystemAssert", ".", "requireArgument", "(", "name", "!=", "null", "&&", "!", "name", ".", "isEmpty", "(", ")", ",", "\"Dashboard Name cannot be null or empty\"", ")", ";", "this", ".", "name", "=...
Sets the name for this Dashboard. @param name The new name for the Dashboard. Cannot be null or empty.
[ "Sets", "the", "name", "for", "this", "Dashboard", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Dashboard.java#L428-L431
121,041
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricUnionTransform.java
MetricUnionTransform.union
public List<Metric> union(List<Metric> metrics) { SystemAssert.requireArgument(metrics != null, "Cannot transform empty metric/metrics"); if (metrics.isEmpty()) { return metrics; } Metric newMetric = reduce(metrics); Map<Long, Double> reducedDatapoints = newMetric.ge...
java
public List<Metric> union(List<Metric> metrics) { SystemAssert.requireArgument(metrics != null, "Cannot transform empty metric/metrics"); if (metrics.isEmpty()) { return metrics; } Metric newMetric = reduce(metrics); Map<Long, Double> reducedDatapoints = newMetric.ge...
[ "public", "List", "<", "Metric", ">", "union", "(", "List", "<", "Metric", ">", "metrics", ")", "{", "SystemAssert", ".", "requireArgument", "(", "metrics", "!=", "null", ",", "\"Cannot transform empty metric/metrics\"", ")", ";", "if", "(", "metrics", ".", ...
Performs a columnar union of metrics. @param metrics The metrics to merge. @return The merged metrics.
[ "Performs", "a", "columnar", "union", "of", "metrics", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricUnionTransform.java#L100-L121
121,042
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Trigger.java
Trigger.setInertia
public void setInertia(Long inertiaMillis) { if (this.alert == null) { // Only during deserialization. this.inertia = inertiaMillis; } else { requireArgument(inertiaMillis != null && inertiaMillis >= 0, "Inertia cannot be negative."); Long longestIntervalLength = Aler...
java
public void setInertia(Long inertiaMillis) { if (this.alert == null) { // Only during deserialization. this.inertia = inertiaMillis; } else { requireArgument(inertiaMillis != null && inertiaMillis >= 0, "Inertia cannot be negative."); Long longestIntervalLength = Aler...
[ "public", "void", "setInertia", "(", "Long", "inertiaMillis", ")", "{", "if", "(", "this", ".", "alert", "==", "null", ")", "{", "// Only during deserialization.", "this", ".", "inertia", "=", "inertiaMillis", ";", "}", "else", "{", "requireArgument", "(", "...
Sets the inertia associated with the trigger in milliseconds. @param inertiaMillis The inertia associated with the trigger in milliseconds. Cannot be null or negative.
[ "Sets", "the", "inertia", "associated", "with", "the", "trigger", "in", "milliseconds", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Trigger.java#L364-L374
121,043
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/MetatagsRecord.java
MetatagsRecord.getMetatags
public Map<String, String> getMetatags() { Map<String, String> result = new HashMap<>(); for (Map.Entry<String, String> entry : _metatags.entrySet()) { String key = entry.getKey(); if (!ReservedField.isReservedField(key)) { result.put(key, entry.getValue()); ...
java
public Map<String, String> getMetatags() { Map<String, String> result = new HashMap<>(); for (Map.Entry<String, String> entry : _metatags.entrySet()) { String key = entry.getKey(); if (!ReservedField.isReservedField(key)) { result.put(key, entry.getValue()); ...
[ "public", "Map", "<", "String", ",", "String", ">", "getMetatags", "(", ")", "{", "Map", "<", "String", ",", "String", ">", "result", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "String", ">", ...
Returns an unmodifiable collection of metatags associated with the metric. @return The metatags for a metric. Will never be null but may be empty.
[ "Returns", "an", "unmodifiable", "collection", "of", "metatags", "associated", "with", "the", "metric", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/MetatagsRecord.java#L77-L88
121,044
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/MetatagsRecord.java
MetatagsRecord.setMetatags
public void setMetatags(Map<String, String> metatags, String key) { if (metatags != null) { TSDBEntity.validateTags(metatags); _metatags.clear(); _metatags.putAll(metatags); _key = key; } }
java
public void setMetatags(Map<String, String> metatags, String key) { if (metatags != null) { TSDBEntity.validateTags(metatags); _metatags.clear(); _metatags.putAll(metatags); _key = key; } }
[ "public", "void", "setMetatags", "(", "Map", "<", "String", ",", "String", ">", "metatags", ",", "String", "key", ")", "{", "if", "(", "metatags", "!=", "null", ")", "{", "TSDBEntity", ".", "validateTags", "(", "metatags", ")", ";", "_metatags", ".", "...
Replaces the metatags for a metric. Metatags cannot use any of the reserved tag names. @param metatags A key-value pairs of metatags. Cannot be null or empty. @param key A unique identifier to be used while indexing this metatags into a schema db.
[ "Replaces", "the", "metatags", "for", "a", "metric", ".", "Metatags", "cannot", "use", "any", "of", "the", "reserved", "tag", "names", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/MetatagsRecord.java#L97-L104
121,045
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/TSDBEntityDto.java
TSDBEntityDto.createDtoObject
public static <D extends TSDBEntityDto, E extends TSDBEntity> D createDtoObject(Class<D> clazz, E tsdbEntity) { D result = null; try { result = clazz.newInstance(); BeanUtils.copyProperties(result, tsdbEntity); } catch (Exception ex) { throw new WebApplicatio...
java
public static <D extends TSDBEntityDto, E extends TSDBEntity> D createDtoObject(Class<D> clazz, E tsdbEntity) { D result = null; try { result = clazz.newInstance(); BeanUtils.copyProperties(result, tsdbEntity); } catch (Exception ex) { throw new WebApplicatio...
[ "public", "static", "<", "D", "extends", "TSDBEntityDto", ",", "E", "extends", "TSDBEntity", ">", "D", "createDtoObject", "(", "Class", "<", "D", ">", "clazz", ",", "E", "tsdbEntity", ")", "{", "D", "result", "=", "null", ";", "try", "{", "result", "="...
Converts a TSDB entity to a DTO. @param <D> The TSDB DTO type. @param <E> The TSDB entity type. @param clazz The runtime type of the DTO object. @param tsdbEntity The TSDB entity to convert. @return The TSDB DTO. @throws WebApplicationException If an error occurs.
[ "Converts", "a", "TSDB", "entity", "to", "a", "DTO", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/TSDBEntityDto.java#L67-L77
121,046
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/notifier/GusNotifier.java
GusNotifier.getHttpClient
public HttpClient getHttpClient(SystemConfiguration config) { HttpClient httpclient = new HttpClient(theConnectionManager); // Wait for 2 seconds to get a connection from pool httpclient.getParams().setParameter("http.connection-manager.timeout", 2000L); String host = config.getValue(Property.GUS_PROXY_HOST...
java
public HttpClient getHttpClient(SystemConfiguration config) { HttpClient httpclient = new HttpClient(theConnectionManager); // Wait for 2 seconds to get a connection from pool httpclient.getParams().setParameter("http.connection-manager.timeout", 2000L); String host = config.getValue(Property.GUS_PROXY_HOST...
[ "public", "HttpClient", "getHttpClient", "(", "SystemConfiguration", "config", ")", "{", "HttpClient", "httpclient", "=", "new", "HttpClient", "(", "theConnectionManager", ")", ";", "// Wait for 2 seconds to get a connection from pool", "httpclient", ".", "getParams", "(", ...
Get HttpClient with proper proxy and timeout settings. @param config The system configuration. Cannot be null. @return HttpClient
[ "Get", "HttpClient", "with", "proper", "proxy", "and", "timeout", "settings", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/notifier/GusNotifier.java#L292-L305
121,047
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/MetricQuery.java
MetricQuery.getTSDBMetricName
@JsonIgnore public String getTSDBMetricName() { StringBuilder sb = new StringBuilder(); sb.append(getMetric()).append(DefaultTSDBService.DELIMITER).append(getScope()); if (_namespace != null && !_namespace.isEmpty()) { sb.append(DefaultTSDBService.DELIMITER).append(getNamespace()); } return sb.toString(...
java
@JsonIgnore public String getTSDBMetricName() { StringBuilder sb = new StringBuilder(); sb.append(getMetric()).append(DefaultTSDBService.DELIMITER).append(getScope()); if (_namespace != null && !_namespace.isEmpty()) { sb.append(DefaultTSDBService.DELIMITER).append(getNamespace()); } return sb.toString(...
[ "@", "JsonIgnore", "public", "String", "getTSDBMetricName", "(", ")", "{", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "sb", ".", "append", "(", "getMetric", "(", ")", ")", ".", "append", "(", "DefaultTSDBService", ".", "DELIMITER", ...
Returns the TSDB metric name. @return The TSDB metric name.
[ "Returns", "the", "TSDB", "metric", "name", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/MetricQuery.java#L200-L210
121,048
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/ItemsCountDto.java
ItemsCountDto.transformToDto
public static ItemsCountDto transformToDto(int value) { if (value < 0) { throw new WebApplicationException("Items count cannot be negative", Status.INTERNAL_SERVER_ERROR); } ItemsCountDto result = new ItemsCountDto(); result.setValue(value); return result; }
java
public static ItemsCountDto transformToDto(int value) { if (value < 0) { throw new WebApplicationException("Items count cannot be negative", Status.INTERNAL_SERVER_ERROR); } ItemsCountDto result = new ItemsCountDto(); result.setValue(value); return result; }
[ "public", "static", "ItemsCountDto", "transformToDto", "(", "int", "value", ")", "{", "if", "(", "value", "<", "0", ")", "{", "throw", "new", "WebApplicationException", "(", "\"Items count cannot be negative\"", ",", "Status", ".", "INTERNAL_SERVER_ERROR", ")", ";...
Converts an integer to ItemsCountDto instance. @param value The items count. @return An itemsCountDto object. @throws WebApplicationException If an error occurs.
[ "Converts", "an", "integer", "to", "ItemsCountDto", "instance", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/ItemsCountDto.java#L69-L77
121,049
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Consumer.java
Consumer.initializeTopic
public void initializeTopic(String topic) { if (_topics.get(topic) == null) { synchronized (this) { if (_topics.get(topic) == null) { _logger.info("Initializing streams for topic: {}", topic); Properties props = new Properties(); ...
java
public void initializeTopic(String topic) { if (_topics.get(topic) == null) { synchronized (this) { if (_topics.get(topic) == null) { _logger.info("Initializing streams for topic: {}", topic); Properties props = new Properties(); ...
[ "public", "void", "initializeTopic", "(", "String", "topic", ")", "{", "if", "(", "_topics", ".", "get", "(", "topic", ")", "==", "null", ")", "{", "synchronized", "(", "this", ")", "{", "if", "(", "_topics", ".", "get", "(", "topic", ")", "==", "n...
This method creates Kafka streams for a topic so that messages can be streamed to the local buffer. If the streams for the given topic have already been initialized the returns. Information about a particular topic is stored in a HashMap. This method uses double-checked locking to make sure only one client thread can i...
[ "This", "method", "creates", "Kafka", "streams", "for", "a", "topic", "so", "that", "messages", "can", "be", "streamed", "to", "the", "local", "buffer", ".", "If", "the", "streams", "for", "the", "given", "topic", "have", "already", "been", "initialized", ...
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Consumer.java#L103-L128
121,050
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Consumer.java
Consumer._startStreamingMessages
private void _startStreamingMessages(String topic, List<KafkaStream<byte[], byte[]>> streams) { ExecutorService executorService = _topics.get(topic).getStreamExecutorService(); for (final KafkaStream<byte[], byte[]> stream : streams) { executorService.submit(new KafkaConsumer(stream)); ...
java
private void _startStreamingMessages(String topic, List<KafkaStream<byte[], byte[]>> streams) { ExecutorService executorService = _topics.get(topic).getStreamExecutorService(); for (final KafkaStream<byte[], byte[]> stream : streams) { executorService.submit(new KafkaConsumer(stream)); ...
[ "private", "void", "_startStreamingMessages", "(", "String", "topic", ",", "List", "<", "KafkaStream", "<", "byte", "[", "]", ",", "byte", "[", "]", ">", ">", "streams", ")", "{", "ExecutorService", "executorService", "=", "_topics", ".", "get", "(", "topi...
Retrieves the executor service for the given topic from the map of topics and submits a KafkaConsumer task for each stream in the list of streams. @param topic The topic to start streaming messages from. @param streams The streams for those messages.
[ "Retrieves", "the", "executor", "service", "for", "the", "given", "topic", "from", "the", "map", "of", "topics", "and", "submits", "a", "KafkaConsumer", "task", "for", "each", "stream", "in", "the", "list", "of", "streams", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Consumer.java#L145-L151
121,051
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Consumer.java
Consumer.dequeueFromBuffer
public <T extends Serializable> List<T> dequeueFromBuffer(String topic, Class<T> type, int timeout, int limit) { List<T> result = new ArrayList<T>(); long cutoff = System.currentTimeMillis() + timeout; BlockingQueue<String> queue = _topics.get(topic).getMessages(); while (System.current...
java
public <T extends Serializable> List<T> dequeueFromBuffer(String topic, Class<T> type, int timeout, int limit) { List<T> result = new ArrayList<T>(); long cutoff = System.currentTimeMillis() + timeout; BlockingQueue<String> queue = _topics.get(topic).getMessages(); while (System.current...
[ "public", "<", "T", "extends", "Serializable", ">", "List", "<", "T", ">", "dequeueFromBuffer", "(", "String", "topic", ",", "Class", "<", "T", ">", "type", ",", "int", "timeout", ",", "int", "limit", ")", "{", "List", "<", "T", ">", "result", "=", ...
Dequeues messages from the local buffer as specified by the limit. If no messages are available to dequeue, then waits for at most timeout milliseconds before returning. @param <T> The result type. @param topic The topic to dequeue messages from. @param type The type that each message should be conve...
[ "Dequeues", "messages", "from", "the", "local", "buffer", "as", "specified", "by", "the", "limit", ".", "If", "no", "messages", "are", "available", "to", "dequeue", "then", "waits", "for", "at", "most", "timeout", "milliseconds", "before", "returning", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Consumer.java#L166-L196
121,052
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Consumer.java
Consumer.shutdown
public void shutdown() { for (Topic topic : _topics.values()) { if (topic.getConsumerConnector() != null) { topic.getConsumerConnector().shutdown(); } topic.getStreamExecutorService().shutdownNow(); try { topic.getStreamExecutorServ...
java
public void shutdown() { for (Topic topic : _topics.values()) { if (topic.getConsumerConnector() != null) { topic.getConsumerConnector().shutdown(); } topic.getStreamExecutorService().shutdownNow(); try { topic.getStreamExecutorServ...
[ "public", "void", "shutdown", "(", ")", "{", "for", "(", "Topic", "topic", ":", "_topics", ".", "values", "(", ")", ")", "{", "if", "(", "topic", ".", "getConsumerConnector", "(", ")", "!=", "null", ")", "{", "topic", ".", "getConsumerConnector", "(", ...
Enqueue un-flushed messages back on to Kafka.
[ "Enqueue", "un", "-", "flushed", "messages", "back", "on", "to", "Kafka", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/mq/kafka/Consumer.java#L242-L270
121,053
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/util/Cron.java
Cron.shouldRun
public static boolean shouldRun(String entry, Date atTime) { entry = entry.trim().toUpperCase(); if (ANNUALLY.equals(entry) || (YEARLY.equals(entry))) { entry = "0 0 1 1 *"; } else if (MONTHLY.equals(entry)) { entry = "0 0 1 * *"; } else if (WEEKLY.equals(entry)) { entry = "0 0 * * 0"; } else if (DAI...
java
public static boolean shouldRun(String entry, Date atTime) { entry = entry.trim().toUpperCase(); if (ANNUALLY.equals(entry) || (YEARLY.equals(entry))) { entry = "0 0 1 1 *"; } else if (MONTHLY.equals(entry)) { entry = "0 0 1 * *"; } else if (WEEKLY.equals(entry)) { entry = "0 0 * * 0"; } else if (DAI...
[ "public", "static", "boolean", "shouldRun", "(", "String", "entry", ",", "Date", "atTime", ")", "{", "entry", "=", "entry", ".", "trim", "(", ")", ".", "toUpperCase", "(", ")", ";", "if", "(", "ANNUALLY", ".", "equals", "(", "entry", ")", "||", "(", ...
Determines if the given CRON entry is runnable at this current moment in time. This mimics the original implementation of the CRON table. <p>This implementation supports only the following types of entries:</p> <ol> <li>Standard Entries having form: &lt;minutes&gt; &lt;hours&gt; &lt;days&gt; &lt;months&gt; &lt;days o...
[ "Determines", "if", "the", "given", "CRON", "entry", "is", "runnable", "at", "this", "current", "moment", "in", "time", ".", "This", "mimics", "the", "original", "implementation", "of", "the", "CRON", "table", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/Cron.java#L99-L113
121,054
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/util/Cron.java
Cron.isValid
public static boolean isValid(String entry) { boolean result = true; try { shouldRun(entry); } catch (Exception ex) { result = false; } return result; }
java
public static boolean isValid(String entry) { boolean result = true; try { shouldRun(entry); } catch (Exception ex) { result = false; } return result; }
[ "public", "static", "boolean", "isValid", "(", "String", "entry", ")", "{", "boolean", "result", "=", "true", ";", "try", "{", "shouldRun", "(", "entry", ")", ";", "}", "catch", "(", "Exception", "ex", ")", "{", "result", "=", "false", ";", "}", "ret...
Determines if an entry is valid CRON syntax. @param entry The CRON entry. @return True if the entry is valid CRON syntax.
[ "Determines", "if", "an", "entry", "is", "valid", "CRON", "syntax", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/Cron.java#L133-L142
121,055
salesforce/Argus
ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/AuditService.java
AuditService.getAuditsForEntity
public List<Audit> getAuditsForEntity(BigInteger entityId) throws IOException, TokenExpiredException { String requestUrl = RESOURCE + "/entity/" + entityId.toString(); ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null); assertValidResponse...
java
public List<Audit> getAuditsForEntity(BigInteger entityId) throws IOException, TokenExpiredException { String requestUrl = RESOURCE + "/entity/" + entityId.toString(); ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null); assertValidResponse...
[ "public", "List", "<", "Audit", ">", "getAuditsForEntity", "(", "BigInteger", "entityId", ")", "throws", "IOException", ",", "TokenExpiredException", "{", "String", "requestUrl", "=", "RESOURCE", "+", "\"/entity/\"", "+", "entityId", ".", "toString", "(", ")", "...
Returns the audit history for the given entity. @param entityId The ID of the entity for which to retrieve the audit history. @return The audit history for the entity. @throws IOException If the server cannot be reached. @throws TokenExpiredException If the token sent along with the request has expired
[ "Returns", "the", "audit", "history", "for", "the", "given", "entity", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/AuditService.java#L77-L83
121,056
salesforce/Argus
ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/AuditService.java
AuditService.getAudit
public Audit getAudit(BigInteger id) throws IOException, TokenExpiredException { String requestUrl = RESOURCE + "/" + id.toString(); ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null); assertValidResponse(response, requestUrl); ret...
java
public Audit getAudit(BigInteger id) throws IOException, TokenExpiredException { String requestUrl = RESOURCE + "/" + id.toString(); ArgusResponse response = getClient().executeHttpRequest(ArgusHttpClient.RequestType.GET, requestUrl, null); assertValidResponse(response, requestUrl); ret...
[ "public", "Audit", "getAudit", "(", "BigInteger", "id", ")", "throws", "IOException", ",", "TokenExpiredException", "{", "String", "requestUrl", "=", "RESOURCE", "+", "\"/\"", "+", "id", ".", "toString", "(", ")", ";", "ArgusResponse", "response", "=", "getCli...
Returns the audit item for the given audit ID. @param id The ID of the audit to retrieve. @return The corresponding audit. @throws IOException If the server cannot be reached. @throws TokenExpiredException If the token sent along with the request has expired
[ "Returns", "the", "audit", "item", "for", "the", "given", "audit", "ID", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/AuditService.java#L95-L101
121,057
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java
AnnotationQuery.setTag
@JsonIgnore public void setTag(String key, String value) { requireArgument(key != null && !key.trim().isEmpty(), "Tag key cannot be null."); requireArgument(!ReservedField.isReservedField(key), "Tag is a reserved tag name."); if (value == null || value.isEmpty()) { _tags.remove(k...
java
@JsonIgnore public void setTag(String key, String value) { requireArgument(key != null && !key.trim().isEmpty(), "Tag key cannot be null."); requireArgument(!ReservedField.isReservedField(key), "Tag is a reserved tag name."); if (value == null || value.isEmpty()) { _tags.remove(k...
[ "@", "JsonIgnore", "public", "void", "setTag", "(", "String", "key", ",", "String", "value", ")", "{", "requireArgument", "(", "key", "!=", "null", "&&", "!", "key", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ",", "\"Tag key cannot be null.\"", ")"...
Sets a single tag for the query. @param key The key for the tag. Cannot null, empty or a reserved field name. @param value The tag value. If the value is null, the tag is removed from the query tags.
[ "Sets", "a", "single", "tag", "for", "the", "query", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java#L194-L203
121,058
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java
AnnotationQuery.getTag
@JsonIgnore public String getTag(String key) { return (!Metric.ReservedField.isReservedField(key)) ? _tags.get(key) : null; }
java
@JsonIgnore public String getTag(String key) { return (!Metric.ReservedField.isReservedField(key)) ? _tags.get(key) : null; }
[ "@", "JsonIgnore", "public", "String", "getTag", "(", "String", "key", ")", "{", "return", "(", "!", "Metric", ".", "ReservedField", ".", "isReservedField", "(", "key", ")", ")", "?", "_tags", ".", "get", "(", "key", ")", ":", "null", ";", "}" ]
Returns the tag value for the given key. @param key The tag key. May be null. @return The value of the tag, or null if no value exists.
[ "Returns", "the", "tag", "value", "for", "the", "given", "key", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java#L212-L215
121,059
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java
AnnotationQuery.setTags
public final void setTags(Map<String, String> tags) { Map<String, String> updatedTags = new TreeMap<>(); if (tags != null) { for (Map.Entry<String, String> entry : tags.entrySet()) { String key = entry.getKey(); requireArgument(!Metric.ReservedField.isReserv...
java
public final void setTags(Map<String, String> tags) { Map<String, String> updatedTags = new TreeMap<>(); if (tags != null) { for (Map.Entry<String, String> entry : tags.entrySet()) { String key = entry.getKey(); requireArgument(!Metric.ReservedField.isReserv...
[ "public", "final", "void", "setTags", "(", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "Map", "<", "String", ",", "String", ">", "updatedTags", "=", "new", "TreeMap", "<>", "(", ")", ";", "if", "(", "tags", "!=", "null", ")", "{", ...
Replaces the tags for the query. @param tags The new tags. May be null.
[ "Replaces", "the", "tags", "for", "the", "query", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java#L222-L235
121,060
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java
AnnotationQuery.setScope
protected void setScope(String scope) { requireArgument(scope != null && !scope.isEmpty(), "Scope cannot be null or empty."); _scope = scope; }
java
protected void setScope(String scope) { requireArgument(scope != null && !scope.isEmpty(), "Scope cannot be null or empty."); _scope = scope; }
[ "protected", "void", "setScope", "(", "String", "scope", ")", "{", "requireArgument", "(", "scope", "!=", "null", "&&", "!", "scope", ".", "isEmpty", "(", ")", ",", "\"Scope cannot be null or empty.\"", ")", ";", "_scope", "=", "scope", ";", "}" ]
Sets the scope of the query. @param scope The scope of the query. Cannot be null.
[ "Sets", "the", "scope", "of", "the", "query", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java#L242-L245
121,061
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java
AnnotationQuery.setMetric
protected void setMetric(String metric) { requireArgument(metric != null && !metric.isEmpty(), "Metric name cannot be null or empty."); _metric = metric; }
java
protected void setMetric(String metric) { requireArgument(metric != null && !metric.isEmpty(), "Metric name cannot be null or empty."); _metric = metric; }
[ "protected", "void", "setMetric", "(", "String", "metric", ")", "{", "requireArgument", "(", "metric", "!=", "null", "&&", "!", "metric", ".", "isEmpty", "(", ")", ",", "\"Metric name cannot be null or empty.\"", ")", ";", "_metric", "=", "metric", ";", "}" ]
Sets the metric name for the query. @param metric The metric name. Cannot be null.
[ "Sets", "the", "metric", "name", "for", "the", "query", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java#L252-L255
121,062
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java
AnnotationQuery.toTagParameterArray
protected String toTagParameterArray(Map<String, String> tags) throws UnsupportedEncodingException { if(tags == null || tags.isEmpty()) { return ""; } StringBuilder sb = new StringBuilder(encode("{", "UTF-8")); for (Map.Entry<String, String> tagEntry : tags.entrySet()) { ...
java
protected String toTagParameterArray(Map<String, String> tags) throws UnsupportedEncodingException { if(tags == null || tags.isEmpty()) { return ""; } StringBuilder sb = new StringBuilder(encode("{", "UTF-8")); for (Map.Entry<String, String> tagEntry : tags.entrySet()) { ...
[ "protected", "String", "toTagParameterArray", "(", "Map", "<", "String", ",", "String", ">", "tags", ")", "throws", "UnsupportedEncodingException", "{", "if", "(", "tags", "==", "null", "||", "tags", ".", "isEmpty", "(", ")", ")", "{", "return", "\"\"", ";...
Returns the tags in TSDB query string format. @param tags The tags to convert. Can be null. @return The formatted tags. @throws UnsupportedEncodingException If UTF-8 is not supported.
[ "Returns", "the", "tags", "in", "TSDB", "query", "string", "format", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/tsdb/AnnotationQuery.java#L266-L282
121,063
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/AnomalyDetectionTransform.java
AnomalyDetectionTransform.getMinMax
private Map<String, Double> getMinMax(Map<Long, Double> metricData) { double min = 0.0; double max = 0.0; boolean isMinMaxSet = false; for (Double value : metricData.values()) { double valueDouble = value; if (!isMinMaxSet) { min = valueDouble; ...
java
private Map<String, Double> getMinMax(Map<Long, Double> metricData) { double min = 0.0; double max = 0.0; boolean isMinMaxSet = false; for (Double value : metricData.values()) { double valueDouble = value; if (!isMinMaxSet) { min = valueDouble; ...
[ "private", "Map", "<", "String", ",", "Double", ">", "getMinMax", "(", "Map", "<", "Long", ",", "Double", ">", "metricData", ")", "{", "double", "min", "=", "0.0", ";", "double", "max", "=", "0.0", ";", "boolean", "isMinMaxSet", "=", "false", ";", "f...
Identifies the min and max values of a metric @param metricData Metric to find the min and max values of @return Map containing the min and max values of the metric
[ "Identifies", "the", "min", "and", "max", "values", "of", "a", "metric" ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/AnomalyDetectionTransform.java#L153-L176
121,064
salesforce/Argus
ArgusClient/src/main/java/com/salesforce/dva/argus/client/Main.java
Main.main
static void main(String[] args, PrintStream out) throws IOException { try { Main main = null; Option[] options = Option.parseCLArgs(args, TEMPLATES); Option helpOption = (options == null) ? null : findOption(HELP_OPTION.getName(), options); Option installOption = ...
java
static void main(String[] args, PrintStream out) throws IOException { try { Main main = null; Option[] options = Option.parseCLArgs(args, TEMPLATES); Option helpOption = (options == null) ? null : findOption(HELP_OPTION.getName(), options); Option installOption = ...
[ "static", "void", "main", "(", "String", "[", "]", "args", ",", "PrintStream", "out", ")", "throws", "IOException", "{", "try", "{", "Main", "main", "=", "null", ";", "Option", "[", "]", "options", "=", "Option", ".", "parseCLArgs", "(", "args", ",", ...
The main invocation method. @param args The command line arguments passed to the invocation. Cannot be null but may be empty. @param out A print stream to facilitate unit testing. Cannot be null. @throws IOException If the configuration file was specified but could not be located.
[ "The", "main", "invocation", "method", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusClient/src/main/java/com/salesforce/dva/argus/client/Main.java#L132-L189
121,065
salesforce/Argus
ArgusClient/src/main/java/com/salesforce/dva/argus/client/Main.java
Main.invoke
void invoke(ClientType clientType) { try { LOGGER.info("Starting service."); ExecutorService service = ClientServiceFactory.startClientService(_system, clientType, _jobCounter); LOGGER.info("Service started."); Thread currentThread = Thread.currentThread(); ...
java
void invoke(ClientType clientType) { try { LOGGER.info("Starting service."); ExecutorService service = ClientServiceFactory.startClientService(_system, clientType, _jobCounter); LOGGER.info("Service started."); Thread currentThread = Thread.currentThread(); ...
[ "void", "invoke", "(", "ClientType", "clientType", ")", "{", "try", "{", "LOGGER", ".", "info", "(", "\"Starting service.\"", ")", ";", "ExecutorService", "service", "=", "ClientServiceFactory", ".", "startClientService", "(", "_system", ",", "clientType", ",", ...
This method creates multiple threads to dequeue messages from message queue and push into TSDB. One thread is created for every type. Depending on message queue connection count, multiple threads may be created for Metric type @param clientType The type of client to invoke. @throws SystemException if an error oc...
[ "This", "method", "creates", "multiple", "threads", "to", "dequeue", "messages", "from", "message", "queue", "and", "push", "into", "TSDB", ".", "One", "thread", "is", "created", "for", "every", "type", ".", "Depending", "on", "message", "queue", "connection",...
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusClient/src/main/java/com/salesforce/dva/argus/client/Main.java#L226-L262
121,066
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/util/zookeeper/Barrier.java
Barrier.enter
public boolean enter() throws KeeperException, InterruptedException{ zooKeeper.create(rootPath + "/" + name, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL); while (true) { synchronized (mutex) { List<String> list = zooKeeper.getChildren(rootPath, true); if (list.size() < size) { mutex.wait...
java
public boolean enter() throws KeeperException, InterruptedException{ zooKeeper.create(rootPath + "/" + name, new byte[0], Ids.OPEN_ACL_UNSAFE, CreateMode.EPHEMERAL); while (true) { synchronized (mutex) { List<String> list = zooKeeper.getChildren(rootPath, true); if (list.size() < size) { mutex.wait...
[ "public", "boolean", "enter", "(", ")", "throws", "KeeperException", ",", "InterruptedException", "{", "zooKeeper", ".", "create", "(", "rootPath", "+", "\"/\"", "+", "name", ",", "new", "byte", "[", "0", "]", ",", "Ids", ".", "OPEN_ACL_UNSAFE", ",", "Crea...
Wait until required number of nodes join barrier @return true when required number of nodes have entered barrier, else wait @throws KeeperException If a keeper exception occurred @throws InterruptedException If interrupted
[ "Wait", "until", "required", "number", "of", "nodes", "join", "barrier" ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/zookeeper/Barrier.java#L131-L144
121,067
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/util/zookeeper/Barrier.java
Barrier.leave
public boolean leave() throws KeeperException, InterruptedException{ zooKeeper.delete(rootPath + "/" + name, 0); while (true) { synchronized (mutex) { List<String> list = zooKeeper.getChildren(rootPath, true); if (list.size() > 0) { mutex.wait(); } else { return true; } } } }
java
public boolean leave() throws KeeperException, InterruptedException{ zooKeeper.delete(rootPath + "/" + name, 0); while (true) { synchronized (mutex) { List<String> list = zooKeeper.getChildren(rootPath, true); if (list.size() > 0) { mutex.wait(); } else { return true; } } } }
[ "public", "boolean", "leave", "(", ")", "throws", "KeeperException", ",", "InterruptedException", "{", "zooKeeper", ".", "delete", "(", "rootPath", "+", "\"/\"", "+", "name", ",", "0", ")", ";", "while", "(", "true", ")", "{", "synchronized", "(", "mutex",...
Wait until all nodes leave barrier @return true when required all nodes have left barrier, else wait. @throws KeeperException If a keeper exception occurred @throws InterruptedException If interrupted
[ "Wait", "until", "all", "nodes", "leave", "barrier" ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/util/zookeeper/Barrier.java#L153-L165
121,068
salesforce/Argus
ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/MetricService.java
MetricService.getMetrics
public List<Metric> getMetrics(List<String> expressions) throws IOException, TokenExpiredException { StringBuilder requestUrl = new StringBuilder(RESOURCE); for (int i = 0; i < expressions.size(); i++) { requestUrl.append(i == 0 ? "?" : "&"); requestUrl.append("expression=").app...
java
public List<Metric> getMetrics(List<String> expressions) throws IOException, TokenExpiredException { StringBuilder requestUrl = new StringBuilder(RESOURCE); for (int i = 0; i < expressions.size(); i++) { requestUrl.append(i == 0 ? "?" : "&"); requestUrl.append("expression=").app...
[ "public", "List", "<", "Metric", ">", "getMetrics", "(", "List", "<", "String", ">", "expressions", ")", "throws", "IOException", ",", "TokenExpiredException", "{", "StringBuilder", "requestUrl", "=", "new", "StringBuilder", "(", "RESOURCE", ")", ";", "for", "...
Returns the metrics for the given set of expressions. @param expressions The metric expressions to evaluate. @return The metrics that match the given expressions. @throws IOException If the server cannot be reached. @throws TokenExpiredException If the token sent along with the request has expired
[ "Returns", "the", "metrics", "for", "the", "given", "set", "of", "expressions", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusSDK/src/main/java/com/salesforce/dva/argus/sdk/MetricService.java#L79-L91
121,069
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/GlobalInterlock.java
GlobalInterlock.obtainLock
public static String obtainLock(EntityManager em, long expiration, long type, String note) { EntityTransaction tx = null; /* remove the existing lock if it's expired */ try { long now = System.currentTimeMillis(); tx = em.getTransaction(); tx.begin(); ...
java
public static String obtainLock(EntityManager em, long expiration, long type, String note) { EntityTransaction tx = null; /* remove the existing lock if it's expired */ try { long now = System.currentTimeMillis(); tx = em.getTransaction(); tx.begin(); ...
[ "public", "static", "String", "obtainLock", "(", "EntityManager", "em", ",", "long", "expiration", ",", "long", "type", ",", "String", "note", ")", "{", "EntityTransaction", "tx", "=", "null", ";", "/* remove the existing lock if it's expired */", "try", "{", "lon...
Obtains a global lock of a given type. @param em The entity manager to use. Cannot be null. @param expiration The time in milliseconds after which an existing lock may be clobbered and re-acquired. @param type The application specific lock type represented as a long value. @param note A...
[ "Obtains", "a", "global", "lock", "of", "a", "given", "type", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/GlobalInterlock.java#L140-L182
121,070
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/GlobalInterlock.java
GlobalInterlock.releaseLock
public static void releaseLock(EntityManager em, long type, String key) { EntityTransaction tx = null; /* remove the existing lock if it matches the key. */ try { tx = em.getTransaction(); tx.begin(); GlobalInterlock lock = _findAndRefreshLock(em, type); ...
java
public static void releaseLock(EntityManager em, long type, String key) { EntityTransaction tx = null; /* remove the existing lock if it matches the key. */ try { tx = em.getTransaction(); tx.begin(); GlobalInterlock lock = _findAndRefreshLock(em, type); ...
[ "public", "static", "void", "releaseLock", "(", "EntityManager", "em", ",", "long", "type", ",", "String", "key", ")", "{", "EntityTransaction", "tx", "=", "null", ";", "/* remove the existing lock if it matches the key. */", "try", "{", "tx", "=", "em", ".", "g...
Releases a global lock of the indicated type if the supplied key is a match for the lock. @param em The entity manager factory to use. Cannot be null. @param type The type of key to release. @param key The key value obtained from the lock creation. @throws GlobalInterlockException If the lock cannot be ...
[ "Releases", "a", "global", "lock", "of", "the", "indicated", "type", "if", "the", "supplied", "key", "is", "a", "match", "for", "the", "lock", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/GlobalInterlock.java#L193-L221
121,071
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/GlobalInterlock.java
GlobalInterlock.refreshLock
public static String refreshLock(EntityManager em, long type, String key, String note) { EntityTransaction tx = null; /* refresh the existing lock if it matches the key. */ try { tx = em.getTransaction(); tx.begin(); GlobalInterlock lock = _findAndRefreshLoc...
java
public static String refreshLock(EntityManager em, long type, String key, String note) { EntityTransaction tx = null; /* refresh the existing lock if it matches the key. */ try { tx = em.getTransaction(); tx.begin(); GlobalInterlock lock = _findAndRefreshLoc...
[ "public", "static", "String", "refreshLock", "(", "EntityManager", "em", ",", "long", "type", ",", "String", "key", ",", "String", "note", ")", "{", "EntityTransaction", "tx", "=", "null", ";", "/* refresh the existing lock if it matches the key. */", "try", "{", ...
Refreshes a global lock of the indicated type if the supplied key is a match for the lock. @param em The entity manager factory to use. Cannot be null. @param type The type of key to release. @param key The key value obtained from the lock creation. @param note A descriptive note about the lock context....
[ "Refreshes", "a", "global", "lock", "of", "the", "indicated", "type", "if", "the", "supplied", "key", "is", "a", "match", "for", "the", "lock", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/GlobalInterlock.java#L235-L265
121,072
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AuditDto.java
AuditDto.transformToDto
public static AuditDto transformToDto(Audit audit) { if (audit == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } AuditDto auditDto = new AuditDto(); try { auditDto.setId(audit....
java
public static AuditDto transformToDto(Audit audit) { if (audit == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } AuditDto auditDto = new AuditDto(); try { auditDto.setId(audit....
[ "public", "static", "AuditDto", "transformToDto", "(", "Audit", "audit", ")", "{", "if", "(", "audit", "==", "null", ")", "{", "throw", "new", "WebApplicationException", "(", "\"Null entity object cannot be converted to Dto object.\"", ",", "Status", ".", "INTERNAL_SE...
Converts the audit entity to DTO. @param audit The audit entity. @return The audit DTO. @throws WebApplicationException If an error occurs.
[ "Converts", "the", "audit", "entity", "to", "DTO", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AuditDto.java#L74-L91
121,073
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AuditDto.java
AuditDto.transformToDto
public static List<AuditDto> transformToDto(List<Audit> audits) { if (audits == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } List<AuditDto> result = new ArrayList<AuditDto>(); for (Audit ...
java
public static List<AuditDto> transformToDto(List<Audit> audits) { if (audits == null) { throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR); } List<AuditDto> result = new ArrayList<AuditDto>(); for (Audit ...
[ "public", "static", "List", "<", "AuditDto", ">", "transformToDto", "(", "List", "<", "Audit", ">", "audits", ")", "{", "if", "(", "audits", "==", "null", ")", "{", "throw", "new", "WebApplicationException", "(", "\"Null entity object cannot be converted to Dto ob...
Converts a list of audit entities to DTOs. @param audits The list of audit entities to convert. @return The list of DTO objects. @throws WebApplicationException If an error occurs.
[ "Converts", "a", "list", "of", "audit", "entities", "to", "DTOs", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/AuditDto.java#L102-L114
121,074
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SuspensionRecord.java
SuspensionRecord.findInfractionCount
public static int findInfractionCount(EntityManager em, PrincipalUser user, SubSystem subSystem, long startTime) { List<SuspensionRecord> records; if (subSystem == null) { records = findByUser(em, user); } else { SuspensionRecord record = findByUserAndSubsystem(em, user,...
java
public static int findInfractionCount(EntityManager em, PrincipalUser user, SubSystem subSystem, long startTime) { List<SuspensionRecord> records; if (subSystem == null) { records = findByUser(em, user); } else { SuspensionRecord record = findByUserAndSubsystem(em, user,...
[ "public", "static", "int", "findInfractionCount", "(", "EntityManager", "em", ",", "PrincipalUser", "user", ",", "SubSystem", "subSystem", ",", "long", "startTime", ")", "{", "List", "<", "SuspensionRecord", ">", "records", ";", "if", "(", "subSystem", "==", "...
Finds the number of user infractions for a subsystem that have occurred since the given start time. @param em The entity manager to use. Cannot be null. @param user The user. Cannot be null. @param subSystem The subsystem. If null, infractions for all subsystems are counted. @param startTime Th...
[ "Finds", "the", "number", "of", "user", "infractions", "for", "a", "subsystem", "that", "have", "occurred", "since", "the", "given", "start", "time", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SuspensionRecord.java#L137-L160
121,075
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SuspensionRecord.java
SuspensionRecord.findByUserAndSubsystem
public static SuspensionRecord findByUserAndSubsystem(EntityManager em, PrincipalUser user, SubSystem subSystem) { TypedQuery<SuspensionRecord> query = em.createNamedQuery("SuspensionRecord.findByUserAndSubsystem", SuspensionRecord.class); try { query.setParameter("user", user); ...
java
public static SuspensionRecord findByUserAndSubsystem(EntityManager em, PrincipalUser user, SubSystem subSystem) { TypedQuery<SuspensionRecord> query = em.createNamedQuery("SuspensionRecord.findByUserAndSubsystem", SuspensionRecord.class); try { query.setParameter("user", user); ...
[ "public", "static", "SuspensionRecord", "findByUserAndSubsystem", "(", "EntityManager", "em", ",", "PrincipalUser", "user", ",", "SubSystem", "subSystem", ")", "{", "TypedQuery", "<", "SuspensionRecord", ">", "query", "=", "em", ".", "createNamedQuery", "(", "\"Susp...
Find the suspension record for a given user-subsystem combination. @param em The EntityManager to use. @param user The user for which to retrieve record. @param subSystem THe subsystem for which to retrieve record. @return The suspension record for the given user-subsystem combination. Null if n...
[ "Find", "the", "suspension", "record", "for", "a", "given", "user", "-", "subsystem", "combination", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SuspensionRecord.java#L171-L182
121,076
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SuspensionRecord.java
SuspensionRecord.findByUser
public static List<SuspensionRecord> findByUser(EntityManager em, PrincipalUser user) { TypedQuery<SuspensionRecord> query = em.createNamedQuery("SuspensionRecord.findByUser", SuspensionRecord.class); try { query.setParameter("user", user); return query.getResultList(); ...
java
public static List<SuspensionRecord> findByUser(EntityManager em, PrincipalUser user) { TypedQuery<SuspensionRecord> query = em.createNamedQuery("SuspensionRecord.findByUser", SuspensionRecord.class); try { query.setParameter("user", user); return query.getResultList(); ...
[ "public", "static", "List", "<", "SuspensionRecord", ">", "findByUser", "(", "EntityManager", "em", ",", "PrincipalUser", "user", ")", "{", "TypedQuery", "<", "SuspensionRecord", ">", "query", "=", "em", ".", "createNamedQuery", "(", "\"SuspensionRecord.findByUser\"...
Find all suspension records for a given user. @param em The EntityManager to use. @param user The user for which to retrieve records. @return A list of suspension records for the given user. An empty list if no such records exist.
[ "Find", "all", "suspension", "records", "for", "a", "given", "user", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SuspensionRecord.java#L192-L201
121,077
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SuspensionRecord.java
SuspensionRecord.setInfractionHistory
public void setInfractionHistory(List<Long> history) { SystemAssert.requireArgument(history != null && !history.isEmpty(), "Infraction History cannot be set to null or empty."); this.infractionHistory = history; }
java
public void setInfractionHistory(List<Long> history) { SystemAssert.requireArgument(history != null && !history.isEmpty(), "Infraction History cannot be set to null or empty."); this.infractionHistory = history; }
[ "public", "void", "setInfractionHistory", "(", "List", "<", "Long", ">", "history", ")", "{", "SystemAssert", ".", "requireArgument", "(", "history", "!=", "null", "&&", "!", "history", ".", "isEmpty", "(", ")", ",", "\"Infraction History cannot be set to null or ...
Sets the detailed infraction history. @param history The detailed infraction history. Cannot be null or empty.
[ "Sets", "the", "detailed", "infraction", "history", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/SuspensionRecord.java#L257-L260
121,078
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/TSDBEntity.java
TSDBEntity.getTags
public Map<String, String> getTags() { Map<String, String> result = new HashMap<>(); for (Map.Entry<String, String> entry : _tags.entrySet()) { String key = entry.getKey(); if (!ReservedField.isReservedField(key)) { result.put(key, entry.getValue()); ...
java
public Map<String, String> getTags() { Map<String, String> result = new HashMap<>(); for (Map.Entry<String, String> entry : _tags.entrySet()) { String key = entry.getKey(); if (!ReservedField.isReservedField(key)) { result.put(key, entry.getValue()); ...
[ "public", "Map", "<", "String", ",", "String", ">", "getTags", "(", ")", "{", "Map", "<", "String", ",", "String", ">", "result", "=", "new", "HashMap", "<>", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "String", ">", "ent...
Returns an unmodifiable collection of tags associated with the metric. @return The tags for a metric. Will never be null but may be empty.
[ "Returns", "an", "unmodifiable", "collection", "of", "tags", "associated", "with", "the", "metric", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/TSDBEntity.java#L137-L148
121,079
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/TSDBEntity.java
TSDBEntity.setTags
public void setTags(Map<String, String> tags) { TSDBEntity.validateTags(tags); _tags.clear(); if (tags != null) { _tags.putAll(tags); } }
java
public void setTags(Map<String, String> tags) { TSDBEntity.validateTags(tags); _tags.clear(); if (tags != null) { _tags.putAll(tags); } }
[ "public", "void", "setTags", "(", "Map", "<", "String", ",", "String", ">", "tags", ")", "{", "TSDBEntity", ".", "validateTags", "(", "tags", ")", ";", "_tags", ".", "clear", "(", ")", ";", "if", "(", "tags", "!=", "null", ")", "{", "_tags", ".", ...
Replaces the tags for a metric. Tags cannot use any of the reserved tag names. @param tags The new tags for the metric.
[ "Replaces", "the", "tags", "for", "a", "metric", ".", "Tags", "cannot", "use", "any", "of", "the", "reserved", "tag", "names", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/TSDBEntity.java#L155-L162
121,080
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Annotation.java
Annotation.setType
private void setType(String type) { requireArgument(type != null && !type.trim().isEmpty(), "Type cannot be null or empty."); _type = type; }
java
private void setType(String type) { requireArgument(type != null && !type.trim().isEmpty(), "Type cannot be null or empty."); _type = type; }
[ "private", "void", "setType", "(", "String", "type", ")", "{", "requireArgument", "(", "type", "!=", "null", "&&", "!", "type", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ",", "\"Type cannot be null or empty.\"", ")", ";", "_type", "=", "type", ";"...
Sets the category of the metric. @param type The category of the metric. Cannot be null or empty.
[ "Sets", "the", "category", "of", "the", "metric", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Annotation.java#L217-L220
121,081
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Annotation.java
Annotation.setSource
private void setSource(String source) { requireArgument(source != null && !source.trim().isEmpty(), "Source cannot be null or empty."); _source = source; }
java
private void setSource(String source) { requireArgument(source != null && !source.trim().isEmpty(), "Source cannot be null or empty."); _source = source; }
[ "private", "void", "setSource", "(", "String", "source", ")", "{", "requireArgument", "(", "source", "!=", "null", "&&", "!", "source", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ",", "\"Source cannot be null or empty.\"", ")", ";", "_source", "=", "...
Sets the source of the annotation. @param source The source of the annotation. Cannot be null or empty.
[ "Sets", "the", "source", "of", "the", "annotation", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Annotation.java#L237-L240
121,082
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Annotation.java
Annotation.setId
private void setId(String id) { requireArgument(id != null && !id.trim().isEmpty(), "ID cannot be null or empty."); _id = id; }
java
private void setId(String id) { requireArgument(id != null && !id.trim().isEmpty(), "ID cannot be null or empty."); _id = id; }
[ "private", "void", "setId", "(", "String", "id", ")", "{", "requireArgument", "(", "id", "!=", "null", "&&", "!", "id", ".", "trim", "(", ")", ".", "isEmpty", "(", ")", ",", "\"ID cannot be null or empty.\"", ")", ";", "_id", "=", "id", ";", "}" ]
Sets the ID of the annotation as indicated by the data source. @param id The ID of the annotation. Will never be null.
[ "Sets", "the", "ID", "of", "the", "annotation", "as", "indicated", "by", "the", "data", "source", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Annotation.java#L247-L250
121,083
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Annotation.java
Annotation.setFields
public void setFields(Map<String, String> fields) { _fields.clear(); if (fields != null) { _fields.putAll(fields); } }
java
public void setFields(Map<String, String> fields) { _fields.clear(); if (fields != null) { _fields.putAll(fields); } }
[ "public", "void", "setFields", "(", "Map", "<", "String", ",", "String", ">", "fields", ")", "{", "_fields", ".", "clear", "(", ")", ";", "if", "(", "fields", "!=", "null", ")", "{", "_fields", ".", "putAll", "(", "fields", ")", ";", "}", "}" ]
Replaces the user defined fields associated with the annotation. This information can be used to store information about the annotation such as the event name, the associated user or any other relevant information. Existing fields will always be deleted. @param fields The user defined fields. May be null.
[ "Replaces", "the", "user", "defined", "fields", "associated", "with", "the", "annotation", ".", "This", "information", "can", "be", "used", "to", "store", "information", "about", "the", "annotation", "such", "as", "the", "event", "name", "the", "associated", "...
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/Annotation.java#L258-L263
121,084
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PolicyLimit.java
PolicyLimit.findPolicyLimitByUserAndCounter
public static PolicyLimit findPolicyLimitByUserAndCounter(EntityManager em, PrincipalUser user, PolicyCounter counter) { TypedQuery<PolicyLimit> query = em.createNamedQuery("PolicyLimit.findPolicyLimitByUserAndCounter", PolicyLimit.class); try { query.setParameter("user", user); ...
java
public static PolicyLimit findPolicyLimitByUserAndCounter(EntityManager em, PrincipalUser user, PolicyCounter counter) { TypedQuery<PolicyLimit> query = em.createNamedQuery("PolicyLimit.findPolicyLimitByUserAndCounter", PolicyLimit.class); try { query.setParameter("user", user); ...
[ "public", "static", "PolicyLimit", "findPolicyLimitByUserAndCounter", "(", "EntityManager", "em", ",", "PrincipalUser", "user", ",", "PolicyCounter", "counter", ")", "{", "TypedQuery", "<", "PolicyLimit", ">", "query", "=", "em", ".", "createNamedQuery", "(", "\"Pol...
Retrieves the policy limit object for a given user-counter combination. @param em The EntityManager to use. @param user The user for which to retrieve the policy limit. @param counter The counter for which to retrieve the policy limit. @return The policy limit object for the given user-counter combi...
[ "Retrieves", "the", "policy", "limit", "object", "for", "a", "given", "user", "-", "counter", "combination", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PolicyLimit.java#L129-L139
121,085
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PolicyLimit.java
PolicyLimit.getLimitByUserAndCounter
public static double getLimitByUserAndCounter(EntityManager em, PrincipalUser user, PolicyCounter counter) { PolicyLimit pLimit = findPolicyLimitByUserAndCounter(em, user, counter); if (pLimit != null) { return pLimit.getLimit(); } return counter.getDefaultValue(); }
java
public static double getLimitByUserAndCounter(EntityManager em, PrincipalUser user, PolicyCounter counter) { PolicyLimit pLimit = findPolicyLimitByUserAndCounter(em, user, counter); if (pLimit != null) { return pLimit.getLimit(); } return counter.getDefaultValue(); }
[ "public", "static", "double", "getLimitByUserAndCounter", "(", "EntityManager", "em", ",", "PrincipalUser", "user", ",", "PolicyCounter", "counter", ")", "{", "PolicyLimit", "pLimit", "=", "findPolicyLimitByUserAndCounter", "(", "em", ",", "user", ",", "counter", ")...
Retrieves the limit for a given user-counter combination. @param em The EntityManager to use. @param user The user for which to retrieve the policy limit. @param counter The counter for which to retrieve the policy limit. @return The limit for the given user-counter combination. Default value of the...
[ "Retrieves", "the", "limit", "for", "a", "given", "user", "-", "counter", "combination", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/PolicyLimit.java#L150-L157
121,086
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java
ServiceManagementRecord.findServiceManagementRecord
public static ServiceManagementRecord findServiceManagementRecord(EntityManager em, Service service) { requireArgument(em != null, "Entity manager can not be null."); requireArgument(service != null, "Service cannot be null."); TypedQuery<ServiceManagementRecord> query = em.createNamedQuery("Se...
java
public static ServiceManagementRecord findServiceManagementRecord(EntityManager em, Service service) { requireArgument(em != null, "Entity manager can not be null."); requireArgument(service != null, "Service cannot be null."); TypedQuery<ServiceManagementRecord> query = em.createNamedQuery("Se...
[ "public", "static", "ServiceManagementRecord", "findServiceManagementRecord", "(", "EntityManager", "em", ",", "Service", "service", ")", "{", "requireArgument", "(", "em", "!=", "null", ",", "\"Entity manager can not be null.\"", ")", ";", "requireArgument", "(", "serv...
Returns a record for the specified service. @param em The entity manager to use. Cannot be null. @param service The service for which to obtain the record. Cannot be null. @return The management record for the specified service or null if no record exists.
[ "Returns", "a", "record", "for", "the", "specified", "service", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java#L117-L129
121,087
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java
ServiceManagementRecord.isServiceEnabled
public static boolean isServiceEnabled(EntityManager em, Service service) { ServiceManagementRecord record = findServiceManagementRecord(em, service); return record == null ? true : record.isEnabled(); }
java
public static boolean isServiceEnabled(EntityManager em, Service service) { ServiceManagementRecord record = findServiceManagementRecord(em, service); return record == null ? true : record.isEnabled(); }
[ "public", "static", "boolean", "isServiceEnabled", "(", "EntityManager", "em", ",", "Service", "service", ")", "{", "ServiceManagementRecord", "record", "=", "findServiceManagementRecord", "(", "em", ",", "service", ")", ";", "return", "record", "==", "null", "?",...
Determine a given service's enability. @param em The EntityManager to use. @param service The service for which to determine enability. @return True or false depending on whether the service is enabled or disabled.
[ "Determine", "a", "given", "service", "s", "enability", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java#L139-L143
121,088
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java
ServiceManagementRecord.updateServiceManagementRecord
@Transactional public static ServiceManagementRecord updateServiceManagementRecord(EntityManager em, ServiceManagementRecord record) { SystemAssert.requireArgument(em != null, "Entity manager can not be null."); SystemAssert.requireArgument(record != null, "ServiceManagementRecord cannot be null.");...
java
@Transactional public static ServiceManagementRecord updateServiceManagementRecord(EntityManager em, ServiceManagementRecord record) { SystemAssert.requireArgument(em != null, "Entity manager can not be null."); SystemAssert.requireArgument(record != null, "ServiceManagementRecord cannot be null.");...
[ "@", "Transactional", "public", "static", "ServiceManagementRecord", "updateServiceManagementRecord", "(", "EntityManager", "em", ",", "ServiceManagementRecord", "record", ")", "{", "SystemAssert", ".", "requireArgument", "(", "em", "!=", "null", ",", "\"Entity manager ca...
Updates the ServiceManagementRecord entity. @param em Entity manager. Cannot be null. @param record serviceManagementRecord object. Cannot be null. @return updated ServiceManagementRecord entity.
[ "Updates", "the", "ServiceManagementRecord", "entity", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java#L153-L169
121,089
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java
DefaultAlertService._processNotification
private void _processNotification(Alert alert, History history, List<Metric> metrics, Map<BigInteger, Map<Metric, Long>> triggerFiredTimesAndMetricsByTrigger, Notification notification, Long alertEnqueueTimestamp) { //refocus notifier does not need cool down logic, and every evaluation needs to send notification...
java
private void _processNotification(Alert alert, History history, List<Metric> metrics, Map<BigInteger, Map<Metric, Long>> triggerFiredTimesAndMetricsByTrigger, Notification notification, Long alertEnqueueTimestamp) { //refocus notifier does not need cool down logic, and every evaluation needs to send notification...
[ "private", "void", "_processNotification", "(", "Alert", "alert", ",", "History", "history", ",", "List", "<", "Metric", ">", "metrics", ",", "Map", "<", "BigInteger", ",", "Map", "<", "Metric", ",", "Long", ">", ">", "triggerFiredTimesAndMetricsByTrigger", ",...
Evaluates all triggers associated with the notification and updates the job history.
[ "Evaluates", "all", "triggers", "associated", "with", "the", "notification", "and", "updates", "the", "job", "history", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java#L589-L633
121,090
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java
DefaultAlertService._processMissingDataNotification
private void _processMissingDataNotification(Alert alert, History history, Set<Trigger> triggers, Notification notification, boolean isDataMissing, Long alertEnqueueTimestamp) { //refocus notifier does not need cool down logic, and every evaluation needs to send notification boolean isRefocusNotifier = SupportedNo...
java
private void _processMissingDataNotification(Alert alert, History history, Set<Trigger> triggers, Notification notification, boolean isDataMissing, Long alertEnqueueTimestamp) { //refocus notifier does not need cool down logic, and every evaluation needs to send notification boolean isRefocusNotifier = SupportedNo...
[ "private", "void", "_processMissingDataNotification", "(", "Alert", "alert", ",", "History", "history", ",", "Set", "<", "Trigger", ">", "triggers", ",", "Notification", "notification", ",", "boolean", "isDataMissing", ",", "Long", "alertEnqueueTimestamp", ")", "{",...
Evaluates all triggers associated with the missing data notification and updates the job history.
[ "Evaluates", "all", "triggers", "associated", "with", "the", "missing", "data", "notification", "and", "updates", "the", "job", "history", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java#L638-L681
121,091
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java
DefaultAlertService._shouldEvaluateAlert
private boolean _shouldEvaluateAlert(Alert alert, BigInteger alertId) { if (alert == null) { _logger.warn(MessageFormat.format("Could not find alert ID {0}", alertId)); return false; } if(!alert.isEnabled()) { _logger.warn(MessageFormat.format("Alert {0} has been disabled. Will not evaluate.", alert.getI...
java
private boolean _shouldEvaluateAlert(Alert alert, BigInteger alertId) { if (alert == null) { _logger.warn(MessageFormat.format("Could not find alert ID {0}", alertId)); return false; } if(!alert.isEnabled()) { _logger.warn(MessageFormat.format("Alert {0} has been disabled. Will not evaluate.", alert.getI...
[ "private", "boolean", "_shouldEvaluateAlert", "(", "Alert", "alert", ",", "BigInteger", "alertId", ")", "{", "if", "(", "alert", "==", "null", ")", "{", "_logger", ".", "warn", "(", "MessageFormat", ".", "format", "(", "\"Could not find alert ID {0}\"", ",", "...
Determines if the alert should be evaluated or not.
[ "Determines", "if", "the", "alert", "should", "be", "evaluated", "or", "not", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java#L687-L698
121,092
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java
DefaultAlertService._evaluateTriggers
private Map<BigInteger, Map<Metric, Long>> _evaluateTriggers(Set<Trigger> triggers, List<Metric> metrics, String queryExpression, Long alertEnqueueTimestamp) { Map<BigInteger, Map<Metric, Long>> triggerFiredTimesAndMetricsByTrigger = new HashMap<>(); for(Trigger trigger : triggers) { Map<Metric, Long> triggerFi...
java
private Map<BigInteger, Map<Metric, Long>> _evaluateTriggers(Set<Trigger> triggers, List<Metric> metrics, String queryExpression, Long alertEnqueueTimestamp) { Map<BigInteger, Map<Metric, Long>> triggerFiredTimesAndMetricsByTrigger = new HashMap<>(); for(Trigger trigger : triggers) { Map<Metric, Long> triggerFi...
[ "private", "Map", "<", "BigInteger", ",", "Map", "<", "Metric", ",", "Long", ">", ">", "_evaluateTriggers", "(", "Set", "<", "Trigger", ">", "triggers", ",", "List", "<", "Metric", ">", "metrics", ",", "String", "queryExpression", ",", "Long", "alertEnqueu...
Evaluates all triggers for the given set of metrics and returns a map of triggerIds to a map containing the triggered metric and the trigger fired time.
[ "Evaluates", "all", "triggers", "for", "the", "given", "set", "of", "metrics", "and", "returns", "a", "map", "of", "triggerIds", "to", "a", "map", "containing", "the", "triggered", "metric", "and", "the", "trigger", "fired", "time", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java#L705-L723
121,093
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java
DefaultAlertService.getNotifier
@Override public Notifier getNotifier(SupportedNotifier notifier) { switch (notifier) { case CALLBACK: return _notifierFactory.getCallbackNotifier(); case EMAIL: return _notifierFactory.getEmailNotifier(); case GOC: return _notifierFactory.getGOCNotifier(); case DATABASE: return _notifierFactory....
java
@Override public Notifier getNotifier(SupportedNotifier notifier) { switch (notifier) { case CALLBACK: return _notifierFactory.getCallbackNotifier(); case EMAIL: return _notifierFactory.getEmailNotifier(); case GOC: return _notifierFactory.getGOCNotifier(); case DATABASE: return _notifierFactory....
[ "@", "Override", "public", "Notifier", "getNotifier", "(", "SupportedNotifier", "notifier", ")", "{", "switch", "(", "notifier", ")", "{", "case", "CALLBACK", ":", "return", "_notifierFactory", ".", "getCallbackNotifier", "(", ")", ";", "case", "EMAIL", ":", "...
Returns an instance of a supported notifier. @param notifier The supported notifier to obtain an instance for. @return The notifier instance.
[ "Returns", "an", "instance", "of", "a", "supported", "notifier", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/alert/DefaultAlertService.java#L1036-L1058
121,094
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/filter/PerfFilter.java
PerfFilter.doFilter
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = HttpServletRequest.class.cast(request); long start = System.currentTimeMillis(); try { chain.doFilter(request, response); } finally { long d...
java
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = HttpServletRequest.class.cast(request); long start = System.currentTimeMillis(); try { chain.doFilter(request, response); } finally { long d...
[ "@", "Override", "public", "void", "doFilter", "(", "ServletRequest", "request", ",", "ServletResponse", "response", ",", "FilterChain", "chain", ")", "throws", "IOException", ",", "ServletException", "{", "HttpServletRequest", "req", "=", "HttpServletRequest", ".", ...
Updates performance counters using the Argus monitoring service. @param request The HTTP request. @param response The HTTP response. @param chain The filter chain to execute. @throws IOException If an I/O error occurs. @throws ServletException If an unknown error occurs.
[ "Updates", "performance", "counters", "using", "the", "Argus", "monitoring", "service", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/filter/PerfFilter.java#L97-L110
121,095
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricDistiller.java
MetricDistiller.setCommonAttributes
public static void setCommonAttributes(List<Metric> metrics, Metric result) { MetricDistiller distiller = new MetricDistiller(); distiller.distill(metrics); result.setDisplayName(distiller.getDisplayName()); result.setUnits(distiller.getUnits()); result.setTags(distiller.getTags...
java
public static void setCommonAttributes(List<Metric> metrics, Metric result) { MetricDistiller distiller = new MetricDistiller(); distiller.distill(metrics); result.setDisplayName(distiller.getDisplayName()); result.setUnits(distiller.getUnits()); result.setTags(distiller.getTags...
[ "public", "static", "void", "setCommonAttributes", "(", "List", "<", "Metric", ">", "metrics", ",", "Metric", "result", ")", "{", "MetricDistiller", "distiller", "=", "new", "MetricDistiller", "(", ")", ";", "distiller", ".", "distill", "(", "metrics", ")", ...
Filters common attributes from list of metrics and writes them to result metric. @param metrics - The set of metrics that needs to be filtered @param result - The resultant metric that gets populated with the common tags
[ "Filters", "common", "attributes", "from", "list", "of", "metrics", "and", "writes", "them", "to", "result", "metric", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricDistiller.java#L65-L72
121,096
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricDistiller.java
MetricDistiller.getTags
public Map<String, String> getTags() { Map<String, String> distilledTags = new HashMap<String, String>(); for (Map.Entry<String, String> entry : potentialTags.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (tagCounts.get(key).equals(t...
java
public Map<String, String> getTags() { Map<String, String> distilledTags = new HashMap<String, String>(); for (Map.Entry<String, String> entry : potentialTags.entrySet()) { String key = entry.getKey(); String value = entry.getValue(); if (tagCounts.get(key).equals(t...
[ "public", "Map", "<", "String", ",", "String", ">", "getTags", "(", ")", "{", "Map", "<", "String", ",", "String", ">", "distilledTags", "=", "new", "HashMap", "<", "String", ",", "String", ">", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", ...
The common tags. @return the common tags, empty map if none are common.
[ "The", "common", "tags", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/metric/transform/MetricDistiller.java#L133-L145
121,097
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/EntityDTO.java
EntityDTO.createDtoObject
public static <D extends EntityDTO, E extends JPAEntity> D createDtoObject(Class<D> clazz, E entity) { D result = null; try { result = clazz.newInstance(); BeanUtils.copyProperties(result, entity); // Now set IDs of JPA entity result.setCreatedById(entit...
java
public static <D extends EntityDTO, E extends JPAEntity> D createDtoObject(Class<D> clazz, E entity) { D result = null; try { result = clazz.newInstance(); BeanUtils.copyProperties(result, entity); // Now set IDs of JPA entity result.setCreatedById(entit...
[ "public", "static", "<", "D", "extends", "EntityDTO", ",", "E", "extends", "JPAEntity", ">", "D", "createDtoObject", "(", "Class", "<", "D", ">", "clazz", ",", "E", "entity", ")", "{", "D", "result", "=", "null", ";", "try", "{", "result", "=", "claz...
Creates BaseDto object and copies properties from entity object. @param <D> BaseDto object type. @param <E> Entity type. @param clazz BaseDto entity class. @param entity entity object. @return BaseDto object. @throws WebApplicationException The exception with 500 status will be thrown.
[ "Creates", "BaseDto", "object", "and", "copies", "properties", "from", "entity", "object", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/EntityDTO.java#L72-L86
121,098
salesforce/Argus
ArgusCore/src/main/java/com/salesforce/dva/argus/service/schedule/RunnableJob.java
RunnableJob.execute
@Override public void execute(JobExecutionContext context) throws JobExecutionException { JobDataMap map = context.getJobDetail().getJobDataMap(); AlertService alertService = (AlertService) map.get("AlertService"); AuditService auditService = (AuditService) map.get("AuditService"); ...
java
@Override public void execute(JobExecutionContext context) throws JobExecutionException { JobDataMap map = context.getJobDetail().getJobDataMap(); AlertService alertService = (AlertService) map.get("AlertService"); AuditService auditService = (AuditService) map.get("AuditService"); ...
[ "@", "Override", "public", "void", "execute", "(", "JobExecutionContext", "context", ")", "throws", "JobExecutionException", "{", "JobDataMap", "map", "=", "context", ".", "getJobDetail", "(", ")", ".", "getJobDataMap", "(", ")", ";", "AlertService", "alertService...
Passing the service instance from quartz main thread, to worker thread as a parameter. Although the alert service used here is not thread safe, we are using the enqueueAlerts in a thread safe manner, since there is no shared mutable state in this method. <p>Not using Guice for injecton of services, since the JPAServic...
[ "Passing", "the", "service", "instance", "from", "quartz", "main", "thread", "to", "worker", "thread", "as", "a", "parameter", ".", "Although", "the", "alert", "service", "used", "here", "is", "not", "thread", "safe", "we", "are", "using", "the", "enqueueAle...
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/service/schedule/RunnableJob.java#L82-L105
121,099
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/filter/LoggingFilter.java
LoggingFilter.doFilter
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = HttpServletRequest.class.cast(request); String url = req.getRequestURI(); LoggerFactory.getLogger(getClass()).debug("Request st...
java
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { HttpServletRequest req = HttpServletRequest.class.cast(request); String url = req.getRequestURI(); LoggerFactory.getLogger(getClass()).debug("Request st...
[ "@", "Override", "public", "void", "doFilter", "(", "ServletRequest", "request", ",", "ServletResponse", "response", ",", "FilterChain", "chain", ")", "throws", "IOException", ",", "ServletException", "{", "HttpServletRequest", "req", "=", "HttpServletRequest", ".", ...
Logs username, request count and timing information. @param request The HTTP request. @param response The HTTP response. @param chain The filter chain to execute. @throws IOException If an I/O exception occurs. @throws ServletException If an unknown error occurs.
[ "Logs", "username", "request", "count", "and", "timing", "information", "." ]
121b59a268da264316cded6a3e9271366a23cd86
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/filter/LoggingFilter.java#L66-L82