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
partition
stringclasses
1 value
box/box-java-sdk
src/main/java/com/box/sdk/BoxFileUploadSession.java
BoxFileUploadSession.getStatus
public BoxFileUploadSession.Info getStatus() { URL statusURL = this.sessionInfo.getSessionEndpoints().getStatusEndpoint(); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), statusURL, HttpMethod.GET); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject jsonOb...
java
public BoxFileUploadSession.Info getStatus() { URL statusURL = this.sessionInfo.getSessionEndpoints().getStatusEndpoint(); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), statusURL, HttpMethod.GET); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject jsonOb...
[ "public", "BoxFileUploadSession", ".", "Info", "getStatus", "(", ")", "{", "URL", "statusURL", "=", "this", ".", "sessionInfo", ".", "getSessionEndpoints", "(", ")", ".", "getStatusEndpoint", "(", ")", ";", "BoxJSONRequest", "request", "=", "new", "BoxJSONReques...
Get the status of the upload session. It contains the number of parts that are processed so far, the total number of parts required for the commit and expiration date and time of the upload session. @return the status.
[ "Get", "the", "status", "of", "the", "upload", "session", ".", "It", "contains", "the", "number", "of", "parts", "that", "are", "processed", "so", "far", "the", "total", "number", "of", "parts", "required", "for", "the", "commit", "and", "expiration", "dat...
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L423-L432
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxFileUploadSession.java
BoxFileUploadSession.abort
public void abort() { URL abortURL = this.sessionInfo.getSessionEndpoints().getAbortEndpoint(); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), abortURL, HttpMethod.DELETE); request.send(); }
java
public void abort() { URL abortURL = this.sessionInfo.getSessionEndpoints().getAbortEndpoint(); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), abortURL, HttpMethod.DELETE); request.send(); }
[ "public", "void", "abort", "(", ")", "{", "URL", "abortURL", "=", "this", ".", "sessionInfo", ".", "getSessionEndpoints", "(", ")", ".", "getAbortEndpoint", "(", ")", ";", "BoxJSONRequest", "request", "=", "new", "BoxJSONRequest", "(", "this", ".", "getAPI",...
Abort an upload session, discarding any chunks that were uploaded to it.
[ "Abort", "an", "upload", "session", "discarding", "any", "chunks", "that", "were", "uploaded", "to", "it", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileUploadSession.java#L437-L441
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIResponse.java
BoxAPIResponse.getHeaderField
public String getHeaderField(String fieldName) { // headers map is null for all regular response calls except when made as a batch request if (this.headers == null) { if (this.connection != null) { return this.connection.getHeaderField(fieldName); } else { ...
java
public String getHeaderField(String fieldName) { // headers map is null for all regular response calls except when made as a batch request if (this.headers == null) { if (this.connection != null) { return this.connection.getHeaderField(fieldName); } else { ...
[ "public", "String", "getHeaderField", "(", "String", "fieldName", ")", "{", "// headers map is null for all regular response calls except when made as a batch request", "if", "(", "this", ".", "headers", "==", "null", ")", "{", "if", "(", "this", ".", "connection", "!="...
Gets the value of the given header field. @param fieldName name of the header field. @return value of the header.
[ "Gets", "the", "value", "of", "the", "given", "header", "field", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIResponse.java#L119-L130
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxAPIResponse.java
BoxAPIResponse.getErrorStream
private InputStream getErrorStream() { InputStream errorStream = this.connection.getErrorStream(); if (errorStream != null) { final String contentEncoding = this.connection.getContentEncoding(); if (contentEncoding != null && contentEncoding.equalsIgnoreCase("gzip")) { ...
java
private InputStream getErrorStream() { InputStream errorStream = this.connection.getErrorStream(); if (errorStream != null) { final String contentEncoding = this.connection.getContentEncoding(); if (contentEncoding != null && contentEncoding.equalsIgnoreCase("gzip")) { ...
[ "private", "InputStream", "getErrorStream", "(", ")", "{", "InputStream", "errorStream", "=", "this", ".", "connection", ".", "getErrorStream", "(", ")", ";", "if", "(", "errorStream", "!=", "null", ")", "{", "final", "String", "contentEncoding", "=", "this", ...
Returns the response error stream, handling the case when it contains gzipped data. @return gzip decoded (if needed) error stream or null
[ "Returns", "the", "response", "error", "stream", "handling", "the", "case", "when", "it", "contains", "gzipped", "data", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxAPIResponse.java#L281-L295
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxWebLink.java
BoxWebLink.updateInfo
public void updateInfo(BoxWebLink.Info info) { URL url = WEB_LINK_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT"); request.setBody(info.getPendingChanges()); String body = info.getPendingChanges(); ...
java
public void updateInfo(BoxWebLink.Info info) { URL url = WEB_LINK_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT"); request.setBody(info.getPendingChanges()); String body = info.getPendingChanges(); ...
[ "public", "void", "updateInfo", "(", "BoxWebLink", ".", "Info", "info", ")", "{", "URL", "url", "=", "WEB_LINK_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "getID", "(", ")", ")", "...
Updates the information about this weblink with any info fields that have been modified locally. <p>The only fields that will be updated are the ones that have been modified locally. For example, the following code won't update any information (or even send a network request) since none of the info's fields were chang...
[ "Updates", "the", "information", "about", "this", "weblink", "with", "any", "info", "fields", "that", "have", "been", "modified", "locally", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxWebLink.java#L188-L196
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxStoragePolicyAssignment.java
BoxStoragePolicyAssignment.create
public static BoxStoragePolicyAssignment.Info create(BoxAPIConnection api, String policyID, String userID) { URL url = STORAGE_POLICY_ASSIGNMENT_URL_TEMPLATE.build(api.getBaseURL()); BoxJSONRequest request = new BoxJSONRequest(api, url, HttpMethod.POST); JsonObject requestJSON = new JsonObject()...
java
public static BoxStoragePolicyAssignment.Info create(BoxAPIConnection api, String policyID, String userID) { URL url = STORAGE_POLICY_ASSIGNMENT_URL_TEMPLATE.build(api.getBaseURL()); BoxJSONRequest request = new BoxJSONRequest(api, url, HttpMethod.POST); JsonObject requestJSON = new JsonObject()...
[ "public", "static", "BoxStoragePolicyAssignment", ".", "Info", "create", "(", "BoxAPIConnection", "api", ",", "String", "policyID", ",", "String", "userID", ")", "{", "URL", "url", "=", "STORAGE_POLICY_ASSIGNMENT_URL_TEMPLATE", ".", "build", "(", "api", ".", "getB...
Create a BoxStoragePolicyAssignment for a BoxStoragePolicy. @param api the API connection to be used by the resource. @param policyID the policy ID of the BoxStoragePolicy. @param userID the user ID of the to assign the BoxStoragePolicy to. @return the information abou...
[ "Create", "a", "BoxStoragePolicyAssignment", "for", "a", "BoxStoragePolicy", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxStoragePolicyAssignment.java#L45-L64
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxStoragePolicyAssignment.java
BoxStoragePolicyAssignment.getAssignmentForTarget
public static BoxStoragePolicyAssignment.Info getAssignmentForTarget(final BoxAPIConnection api, String resolvedForType, String resolvedForID) { QueryStringBuilder builder = new QueryStringBuilder(); builder.appendParam("resolved_f...
java
public static BoxStoragePolicyAssignment.Info getAssignmentForTarget(final BoxAPIConnection api, String resolvedForType, String resolvedForID) { QueryStringBuilder builder = new QueryStringBuilder(); builder.appendParam("resolved_f...
[ "public", "static", "BoxStoragePolicyAssignment", ".", "Info", "getAssignmentForTarget", "(", "final", "BoxAPIConnection", "api", ",", "String", "resolvedForType", ",", "String", "resolvedForID", ")", "{", "QueryStringBuilder", "builder", "=", "new", "QueryStringBuilder",...
Returns a BoxStoragePolicyAssignment information. @param api the API connection to be used by the resource. @param resolvedForType the assigned entity type for the storage policy. @param resolvedForID the assigned entity id for the storage policy. @return information about this {@link BoxStorageP...
[ "Returns", "a", "BoxStoragePolicyAssignment", "information", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxStoragePolicyAssignment.java#L88-L103
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxStoragePolicyAssignment.java
BoxStoragePolicyAssignment.delete
public void delete() { URL url = STORAGE_POLICY_ASSIGNMENT_WITH_ID_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, HttpMethod.DELETE); request.send(); }
java
public void delete() { URL url = STORAGE_POLICY_ASSIGNMENT_WITH_ID_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, HttpMethod.DELETE); request.send(); }
[ "public", "void", "delete", "(", ")", "{", "URL", "url", "=", "STORAGE_POLICY_ASSIGNMENT_WITH_ID_URL_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", "getID", "(", ")", ")", ";", "BoxAPIRequest",...
Deletes this BoxStoragePolicyAssignment.
[ "Deletes", "this", "BoxStoragePolicyAssignment", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxStoragePolicyAssignment.java#L119-L124
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxGroup.java
BoxGroup.getAllGroupsByName
public static Iterable<BoxGroup.Info> getAllGroupsByName(final BoxAPIConnection api, String name) { final QueryStringBuilder builder = new QueryStringBuilder(); if (name == null || name.trim().isEmpty()) { throw new BoxAPIException("Searching groups by name requires a non NULL or non empty n...
java
public static Iterable<BoxGroup.Info> getAllGroupsByName(final BoxAPIConnection api, String name) { final QueryStringBuilder builder = new QueryStringBuilder(); if (name == null || name.trim().isEmpty()) { throw new BoxAPIException("Searching groups by name requires a non NULL or non empty n...
[ "public", "static", "Iterable", "<", "BoxGroup", ".", "Info", ">", "getAllGroupsByName", "(", "final", "BoxAPIConnection", "api", ",", "String", "name", ")", "{", "final", "QueryStringBuilder", "builder", "=", "new", "QueryStringBuilder", "(", ")", ";", "if", ...
Gets an iterable of all the groups in the enterprise that are starting with the given name string. @param api the API connection to be used when retrieving the groups. @param name the name prefix of the groups. If the groups need to searched by full name that has spaces, then the parameter string should have been wra...
[ "Gets", "an", "iterable", "of", "all", "the", "groups", "in", "the", "enterprise", "that", "are", "starting", "with", "the", "given", "name", "string", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxGroup.java#L150-L164
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxGroup.java
BoxGroup.getMemberships
public Collection<BoxGroupMembership.Info> getMemberships() { final BoxAPIConnection api = this.getAPI(); final String groupID = this.getID(); Iterable<BoxGroupMembership.Info> iter = new Iterable<BoxGroupMembership.Info>() { public Iterator<BoxGroupMembership.Info> iterator() { ...
java
public Collection<BoxGroupMembership.Info> getMemberships() { final BoxAPIConnection api = this.getAPI(); final String groupID = this.getID(); Iterable<BoxGroupMembership.Info> iter = new Iterable<BoxGroupMembership.Info>() { public Iterator<BoxGroupMembership.Info> iterator() { ...
[ "public", "Collection", "<", "BoxGroupMembership", ".", "Info", ">", "getMemberships", "(", ")", "{", "final", "BoxAPIConnection", "api", "=", "this", ".", "getAPI", "(", ")", ";", "final", "String", "groupID", "=", "this", ".", "getID", "(", ")", ";", "...
Gets information about all of the group memberships for this group. Does not support paging. @return a collection of information about the group memberships for this group.
[ "Gets", "information", "about", "all", "of", "the", "group", "memberships", "for", "this", "group", ".", "Does", "not", "support", "paging", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxGroup.java#L200-L218
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxGroup.java
BoxGroup.addMembership
public BoxGroupMembership.Info addMembership(BoxUser user, Role role) { BoxAPIConnection api = this.getAPI(); JsonObject requestJSON = new JsonObject(); requestJSON.add("user", new JsonObject().add("id", user.getID())); requestJSON.add("group", new JsonObject().add("id", this.getID()));...
java
public BoxGroupMembership.Info addMembership(BoxUser user, Role role) { BoxAPIConnection api = this.getAPI(); JsonObject requestJSON = new JsonObject(); requestJSON.add("user", new JsonObject().add("id", user.getID())); requestJSON.add("group", new JsonObject().add("id", this.getID()));...
[ "public", "BoxGroupMembership", ".", "Info", "addMembership", "(", "BoxUser", "user", ",", "Role", "role", ")", "{", "BoxAPIConnection", "api", "=", "this", ".", "getAPI", "(", ")", ";", "JsonObject", "requestJSON", "=", "new", "JsonObject", "(", ")", ";", ...
Adds a member to this group with the specified role. @param user the member to be added to this group. @param role the role of the user in this group. Can be null to assign the default role. @return info about the new group membership.
[ "Adds", "a", "member", "to", "this", "group", "with", "the", "specified", "role", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxGroup.java#L254-L272
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTermsOfService.java
BoxTermsOfService.create
public static BoxTermsOfService.Info create(BoxAPIConnection api, BoxTermsOfService.TermsOfServiceStatus termsOfServiceStatus, BoxTermsOfService.TermsOfServiceType termsOfServiceType, String text) { URL url = ALL_TER...
java
public static BoxTermsOfService.Info create(BoxAPIConnection api, BoxTermsOfService.TermsOfServiceStatus termsOfServiceStatus, BoxTermsOfService.TermsOfServiceType termsOfServiceType, String text) { URL url = ALL_TER...
[ "public", "static", "BoxTermsOfService", ".", "Info", "create", "(", "BoxAPIConnection", "api", ",", "BoxTermsOfService", ".", "TermsOfServiceStatus", "termsOfServiceStatus", ",", "BoxTermsOfService", ".", "TermsOfServiceType", "termsOfServiceType", ",", "String", "text", ...
Creates a new Terms of Services. @param api the API connection to be used by the resource. @param termsOfServiceStatus the current status of the terms of services. Set to "enabled" or "disabled". @param termsOfServiceType the scope of terms of service. Set to "external" or "managed". @...
[ "Creates", "a", "new", "Terms", "of", "Services", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTermsOfService.java#L44-L60
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTermsOfService.java
BoxTermsOfService.getAllTermsOfServices
public static List<BoxTermsOfService.Info> getAllTermsOfServices(final BoxAPIConnection api, BoxTermsOfService.TermsOfServiceType termsOfServiceType) { QueryStringBui...
java
public static List<BoxTermsOfService.Info> getAllTermsOfServices(final BoxAPIConnection api, BoxTermsOfService.TermsOfServiceType termsOfServiceType) { QueryStringBui...
[ "public", "static", "List", "<", "BoxTermsOfService", ".", "Info", ">", "getAllTermsOfServices", "(", "final", "BoxAPIConnection", "api", ",", "BoxTermsOfService", ".", "TermsOfServiceType", "termsOfServiceType", ")", "{", "QueryStringBuilder", "builder", "=", "new", ...
Retrieves a list of Terms of Service that belong to your Enterprise as an Iterable. @param api api the API connection to be used by the resource. @param termsOfServiceType the type of terms of service to be retrieved. Can be set to "managed" or "external" @return the Iterable o...
[ "Retrieves", "a", "list", "of", "Terms", "of", "Service", "that", "belong", "to", "your", "Enterprise", "as", "an", "Iterable", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTermsOfService.java#L102-L126
train
box/box-java-sdk
src/main/java/com/box/sdk/internal/utils/Parsers.java
Parsers.parseAndPopulateMetadataMap
public static Map<String, Map<String, Metadata>> parseAndPopulateMetadataMap(JsonObject jsonObject) { Map<String, Map<String, Metadata>> metadataMap = new HashMap<String, Map<String, Metadata>>(); //Parse all templates for (JsonObject.Member templateMember : jsonObject) { if (templat...
java
public static Map<String, Map<String, Metadata>> parseAndPopulateMetadataMap(JsonObject jsonObject) { Map<String, Map<String, Metadata>> metadataMap = new HashMap<String, Map<String, Metadata>>(); //Parse all templates for (JsonObject.Member templateMember : jsonObject) { if (templat...
[ "public", "static", "Map", "<", "String", ",", "Map", "<", "String", ",", "Metadata", ">", ">", "parseAndPopulateMetadataMap", "(", "JsonObject", "jsonObject", ")", "{", "Map", "<", "String", ",", "Map", "<", "String", ",", "Metadata", ">", ">", "metadataM...
Creates a map of metadata from json. @param jsonObject metadata json object for metadata field in get /files?fileds=,etadata.scope.template response @return Map of String as key a value another Map with a String key and Metadata value
[ "Creates", "a", "map", "of", "metadata", "from", "json", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/internal/utils/Parsers.java#L29-L53
train
box/box-java-sdk
src/main/java/com/box/sdk/internal/utils/Parsers.java
Parsers.parseRepresentations
public static List<Representation> parseRepresentations(JsonObject jsonObject) { List<Representation> representations = new ArrayList<Representation>(); for (JsonValue representationJson : jsonObject.get("entries").asArray()) { Representation representation = new Representation(representatio...
java
public static List<Representation> parseRepresentations(JsonObject jsonObject) { List<Representation> representations = new ArrayList<Representation>(); for (JsonValue representationJson : jsonObject.get("entries").asArray()) { Representation representation = new Representation(representatio...
[ "public", "static", "List", "<", "Representation", ">", "parseRepresentations", "(", "JsonObject", "jsonObject", ")", "{", "List", "<", "Representation", ">", "representations", "=", "new", "ArrayList", "<", "Representation", ">", "(", ")", ";", "for", "(", "J...
Parse representations from a file object response. @param jsonObject representations json object in get response for /files/file-id?fields=representations @return list of representations
[ "Parse", "representations", "from", "a", "file", "object", "response", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/internal/utils/Parsers.java#L60-L67
train
box/box-java-sdk
src/main/java/com/box/sdk/BoxTermsOfServiceUserStatus.java
BoxTermsOfServiceUserStatus.updateInfo
public void updateInfo(BoxTermsOfServiceUserStatus.Info info) { URL url = TERMS_OF_SERVICE_USER_STATUSES_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT"); request.setBody(info.getPendingChanges()); BoxJSONRe...
java
public void updateInfo(BoxTermsOfServiceUserStatus.Info info) { URL url = TERMS_OF_SERVICE_USER_STATUSES_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "PUT"); request.setBody(info.getPendingChanges()); BoxJSONRe...
[ "public", "void", "updateInfo", "(", "BoxTermsOfServiceUserStatus", ".", "Info", "info", ")", "{", "URL", "url", "=", "TERMS_OF_SERVICE_USER_STATUSES_TEMPLATE", ".", "build", "(", "this", ".", "getAPI", "(", ")", ".", "getBaseURL", "(", ")", ",", "this", ".", ...
Updates the information about the user status for this terms of service with any info fields that have been modified locally. @param info the updated info.
[ "Updates", "the", "information", "about", "the", "user", "status", "for", "this", "terms", "of", "service", "with", "any", "info", "fields", "that", "have", "been", "modified", "locally", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTermsOfServiceUserStatus.java#L133-L141
train
box/box-java-sdk
src/main/java/com/box/sdk/BatchAPIRequest.java
BatchAPIRequest.execute
public List<BoxAPIResponse> execute(List<BoxAPIRequest> requests) { this.prepareRequest(requests); BoxJSONResponse batchResponse = (BoxJSONResponse) send(); return this.parseResponse(batchResponse); }
java
public List<BoxAPIResponse> execute(List<BoxAPIRequest> requests) { this.prepareRequest(requests); BoxJSONResponse batchResponse = (BoxJSONResponse) send(); return this.parseResponse(batchResponse); }
[ "public", "List", "<", "BoxAPIResponse", ">", "execute", "(", "List", "<", "BoxAPIRequest", ">", "requests", ")", "{", "this", ".", "prepareRequest", "(", "requests", ")", ";", "BoxJSONResponse", "batchResponse", "=", "(", "BoxJSONResponse", ")", "send", "(", ...
Execute a set of API calls as batch request. @param requests list of api requests that has to be executed in batch. @return list of BoxAPIResponses
[ "Execute", "a", "set", "of", "API", "calls", "as", "batch", "request", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BatchAPIRequest.java#L44-L48
train
box/box-java-sdk
src/main/java/com/box/sdk/BatchAPIRequest.java
BatchAPIRequest.prepareRequest
protected void prepareRequest(List<BoxAPIRequest> requests) { JsonObject body = new JsonObject(); JsonArray requestsJSONArray = new JsonArray(); for (BoxAPIRequest request: requests) { JsonObject batchRequest = new JsonObject(); batchRequest.add("method", request.getMetho...
java
protected void prepareRequest(List<BoxAPIRequest> requests) { JsonObject body = new JsonObject(); JsonArray requestsJSONArray = new JsonArray(); for (BoxAPIRequest request: requests) { JsonObject batchRequest = new JsonObject(); batchRequest.add("method", request.getMetho...
[ "protected", "void", "prepareRequest", "(", "List", "<", "BoxAPIRequest", ">", "requests", ")", "{", "JsonObject", "body", "=", "new", "JsonObject", "(", ")", ";", "JsonArray", "requestsJSONArray", "=", "new", "JsonArray", "(", ")", ";", "for", "(", "BoxAPIR...
Prepare a batch api request using list of individual reuests. @param requests list of api requests that has to be executed in batch.
[ "Prepare", "a", "batch", "api", "request", "using", "list", "of", "individual", "reuests", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BatchAPIRequest.java#L54-L84
train
box/box-java-sdk
src/main/java/com/box/sdk/BatchAPIRequest.java
BatchAPIRequest.parseResponse
protected List<BoxAPIResponse> parseResponse(BoxJSONResponse batchResponse) { JsonObject responseJSON = JsonObject.readFrom(batchResponse.getJSON()); List<BoxAPIResponse> responses = new ArrayList<BoxAPIResponse>(); Iterator<JsonValue> responseIterator = responseJSON.get("responses").asArray().i...
java
protected List<BoxAPIResponse> parseResponse(BoxJSONResponse batchResponse) { JsonObject responseJSON = JsonObject.readFrom(batchResponse.getJSON()); List<BoxAPIResponse> responses = new ArrayList<BoxAPIResponse>(); Iterator<JsonValue> responseIterator = responseJSON.get("responses").asArray().i...
[ "protected", "List", "<", "BoxAPIResponse", ">", "parseResponse", "(", "BoxJSONResponse", "batchResponse", ")", "{", "JsonObject", "responseJSON", "=", "JsonObject", ".", "readFrom", "(", "batchResponse", ".", "getJSON", "(", ")", ")", ";", "List", "<", "BoxAPIR...
Parses btch api response to create a list of BoxAPIResponse objects. @param batchResponse response of a batch api request @return list of BoxAPIResponses
[ "Parses", "btch", "api", "response", "to", "create", "a", "list", "of", "BoxAPIResponse", "objects", "." ]
35b4ba69417f9d6a002c19dfaab57527750ef349
https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BatchAPIRequest.java#L91-L125
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/ScanUtil.java
ScanUtil.generateJson
private static void generateJson(CellScanner cellScanner, Function<Bytes, String> encoder, PrintStream out) throws JsonIOException { Gson gson = new GsonBuilder().serializeNulls().setDateFormat(DateFormat.LONG) .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).setVersion(1.0) ...
java
private static void generateJson(CellScanner cellScanner, Function<Bytes, String> encoder, PrintStream out) throws JsonIOException { Gson gson = new GsonBuilder().serializeNulls().setDateFormat(DateFormat.LONG) .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES).setVersion(1.0) ...
[ "private", "static", "void", "generateJson", "(", "CellScanner", "cellScanner", ",", "Function", "<", "Bytes", ",", "String", ">", "encoder", ",", "PrintStream", "out", ")", "throws", "JsonIOException", "{", "Gson", "gson", "=", "new", "GsonBuilder", "(", ")",...
Generate JSON format as result of the scan. @since 1.2
[ "Generate", "JSON", "format", "as", "result", "of", "the", "scan", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/ScanUtil.java#L181-L202
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/impl/TxInfo.java
TxInfo.getTransactionInfo
public static TxInfo getTransactionInfo(Environment env, Bytes prow, Column pcol, long startTs) { // TODO ensure primary is visible IteratorSetting is = new IteratorSetting(10, RollbackCheckIterator.class); RollbackCheckIterator.setLocktime(is, startTs); Entry<Key, Value> entry = ColumnUtil.checkColum...
java
public static TxInfo getTransactionInfo(Environment env, Bytes prow, Column pcol, long startTs) { // TODO ensure primary is visible IteratorSetting is = new IteratorSetting(10, RollbackCheckIterator.class); RollbackCheckIterator.setLocktime(is, startTs); Entry<Key, Value> entry = ColumnUtil.checkColum...
[ "public", "static", "TxInfo", "getTransactionInfo", "(", "Environment", "env", ",", "Bytes", "prow", ",", "Column", "pcol", ",", "long", "startTs", ")", "{", "// TODO ensure primary is visible", "IteratorSetting", "is", "=", "new", "IteratorSetting", "(", "10", ",...
determine the what state a transaction is in by inspecting the primary column
[ "determine", "the", "what", "state", "a", "transaction", "is", "in", "by", "inspecting", "the", "primary", "column" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/TxInfo.java#L40-L102
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/OracleServerUtils.java
OracleServerUtils.oracleExists
public static boolean oracleExists(CuratorFramework curator) { boolean exists = false; try { exists = curator.checkExists().forPath(ZookeeperPath.ORACLE_SERVER) != null && !curator.getChildren().forPath(ZookeeperPath.ORACLE_SERVER).isEmpty(); } catch (Exception nne) { if (nne instanceo...
java
public static boolean oracleExists(CuratorFramework curator) { boolean exists = false; try { exists = curator.checkExists().forPath(ZookeeperPath.ORACLE_SERVER) != null && !curator.getChildren().forPath(ZookeeperPath.ORACLE_SERVER).isEmpty(); } catch (Exception nne) { if (nne instanceo...
[ "public", "static", "boolean", "oracleExists", "(", "CuratorFramework", "curator", ")", "{", "boolean", "exists", "=", "false", ";", "try", "{", "exists", "=", "curator", ".", "checkExists", "(", ")", ".", "forPath", "(", "ZookeeperPath", ".", "ORACLE_SERVER",...
Checks to see if an Oracle Server exists. @param curator It is the responsibility of the caller to ensure the curator is started @return boolean if the server exists in zookeeper
[ "Checks", "to", "see", "if", "an", "Oracle", "Server", "exists", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/OracleServerUtils.java#L32-L45
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/impl/SharedBatchWriter.java
SharedBatchWriter.waitForAsyncFlush
public void waitForAsyncFlush() { long numAdded = asyncBatchesAdded.get(); synchronized (this) { while (numAdded > asyncBatchesProcessed) { try { wait(); } catch (InterruptedException e) { throw new RuntimeException(e); } } } }
java
public void waitForAsyncFlush() { long numAdded = asyncBatchesAdded.get(); synchronized (this) { while (numAdded > asyncBatchesProcessed) { try { wait(); } catch (InterruptedException e) { throw new RuntimeException(e); } } } }
[ "public", "void", "waitForAsyncFlush", "(", ")", "{", "long", "numAdded", "=", "asyncBatchesAdded", ".", "get", "(", ")", ";", "synchronized", "(", "this", ")", "{", "while", "(", "numAdded", ">", "asyncBatchesProcessed", ")", "{", "try", "{", "wait", "(",...
waits for all async mutations that were added before this was called to be flushed. Does not wait for async mutations added after call.
[ "waits", "for", "all", "async", "mutations", "that", "were", "added", "before", "this", "was", "called", "to", "be", "flushed", ".", "Does", "not", "wait", "for", "async", "mutations", "added", "after", "call", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/SharedBatchWriter.java#L216-L228
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Span.java
Span.exact
public static Span exact(Bytes row) { Objects.requireNonNull(row); return new Span(row, true, row, true); }
java
public static Span exact(Bytes row) { Objects.requireNonNull(row); return new Span(row, true, row, true); }
[ "public", "static", "Span", "exact", "(", "Bytes", "row", ")", "{", "Objects", ".", "requireNonNull", "(", "row", ")", ";", "return", "new", "Span", "(", "row", ",", "true", ",", "row", ",", "true", ")", ";", "}" ]
Creates a span that covers an exact row
[ "Creates", "a", "span", "that", "covers", "an", "exact", "row" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Span.java#L206-L209
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Span.java
Span.exact
public static Span exact(CharSequence row) { Objects.requireNonNull(row); return exact(Bytes.of(row)); }
java
public static Span exact(CharSequence row) { Objects.requireNonNull(row); return exact(Bytes.of(row)); }
[ "public", "static", "Span", "exact", "(", "CharSequence", "row", ")", "{", "Objects", ".", "requireNonNull", "(", "row", ")", ";", "return", "exact", "(", "Bytes", ".", "of", "(", "row", ")", ")", ";", "}" ]
Creates a Span that covers an exact row. String parameters will be encoded as UTF-8
[ "Creates", "a", "Span", "that", "covers", "an", "exact", "row", ".", "String", "parameters", "will", "be", "encoded", "as", "UTF", "-", "8" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Span.java#L214-L217
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Span.java
Span.prefix
public static Span prefix(Bytes rowPrefix) { Objects.requireNonNull(rowPrefix); Bytes fp = followingPrefix(rowPrefix); return new Span(rowPrefix, true, fp == null ? Bytes.EMPTY : fp, false); }
java
public static Span prefix(Bytes rowPrefix) { Objects.requireNonNull(rowPrefix); Bytes fp = followingPrefix(rowPrefix); return new Span(rowPrefix, true, fp == null ? Bytes.EMPTY : fp, false); }
[ "public", "static", "Span", "prefix", "(", "Bytes", "rowPrefix", ")", "{", "Objects", ".", "requireNonNull", "(", "rowPrefix", ")", ";", "Bytes", "fp", "=", "followingPrefix", "(", "rowPrefix", ")", ";", "return", "new", "Span", "(", "rowPrefix", ",", "tru...
Returns a Span that covers all rows beginning with a prefix.
[ "Returns", "a", "Span", "that", "covers", "all", "rows", "beginning", "with", "a", "prefix", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Span.java#L266-L270
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Span.java
Span.prefix
public static Span prefix(CharSequence rowPrefix) { Objects.requireNonNull(rowPrefix); return prefix(Bytes.of(rowPrefix)); }
java
public static Span prefix(CharSequence rowPrefix) { Objects.requireNonNull(rowPrefix); return prefix(Bytes.of(rowPrefix)); }
[ "public", "static", "Span", "prefix", "(", "CharSequence", "rowPrefix", ")", "{", "Objects", ".", "requireNonNull", "(", "rowPrefix", ")", ";", "return", "prefix", "(", "Bytes", ".", "of", "(", "rowPrefix", ")", ")", ";", "}" ]
Returns a Span that covers all rows beginning with a prefix String parameters will be encoded as UTF-8
[ "Returns", "a", "Span", "that", "covers", "all", "rows", "beginning", "with", "a", "prefix", "String", "parameters", "will", "be", "encoded", "as", "UTF", "-", "8" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Span.java#L276-L279
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/config/SimpleConfiguration.java
SimpleConfiguration.load
public void load(InputStream in) { try { PropertiesConfiguration config = new PropertiesConfiguration(); // disabled to prevent accumulo classpath value from being shortened config.setDelimiterParsingDisabled(true); config.load(in); ((CompositeConfiguration) internalConfig).addConfigur...
java
public void load(InputStream in) { try { PropertiesConfiguration config = new PropertiesConfiguration(); // disabled to prevent accumulo classpath value from being shortened config.setDelimiterParsingDisabled(true); config.load(in); ((CompositeConfiguration) internalConfig).addConfigur...
[ "public", "void", "load", "(", "InputStream", "in", ")", "{", "try", "{", "PropertiesConfiguration", "config", "=", "new", "PropertiesConfiguration", "(", ")", ";", "// disabled to prevent accumulo classpath value from being shortened", "config", ".", "setDelimiterParsingDi...
Loads configuration from InputStream. Later loads have lower priority. @param in InputStream to load from @since 1.2.0
[ "Loads", "configuration", "from", "InputStream", ".", "Later", "loads", "have", "lower", "priority", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/SimpleConfiguration.java#L176-L186
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/config/SimpleConfiguration.java
SimpleConfiguration.load
public void load(File file) { try { PropertiesConfiguration config = new PropertiesConfiguration(); // disabled to prevent accumulo classpath value from being shortened config.setDelimiterParsingDisabled(true); config.load(file); ((CompositeConfiguration) internalConfig).addConfigurati...
java
public void load(File file) { try { PropertiesConfiguration config = new PropertiesConfiguration(); // disabled to prevent accumulo classpath value from being shortened config.setDelimiterParsingDisabled(true); config.load(file); ((CompositeConfiguration) internalConfig).addConfigurati...
[ "public", "void", "load", "(", "File", "file", ")", "{", "try", "{", "PropertiesConfiguration", "config", "=", "new", "PropertiesConfiguration", "(", ")", ";", "// disabled to prevent accumulo classpath value from being shortened", "config", ".", "setDelimiterParsingDisable...
Loads configuration from File. Later loads have lower priority. @param file File to load from @since 1.2.0
[ "Loads", "configuration", "from", "File", ".", "Later", "loads", "have", "lower", "priority", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/SimpleConfiguration.java#L194-L204
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java
FluoConfigurationImpl.getTxInfoCacheWeight
public static long getTxInfoCacheWeight(FluoConfiguration conf) { long size = conf.getLong(TX_INFO_CACHE_WEIGHT, TX_INFO_CACHE_WEIGHT_DEFAULT); if (size <= 0) { throw new IllegalArgumentException("Cache size must be positive for " + TX_INFO_CACHE_WEIGHT); } return size; }
java
public static long getTxInfoCacheWeight(FluoConfiguration conf) { long size = conf.getLong(TX_INFO_CACHE_WEIGHT, TX_INFO_CACHE_WEIGHT_DEFAULT); if (size <= 0) { throw new IllegalArgumentException("Cache size must be positive for " + TX_INFO_CACHE_WEIGHT); } return size; }
[ "public", "static", "long", "getTxInfoCacheWeight", "(", "FluoConfiguration", "conf", ")", "{", "long", "size", "=", "conf", ".", "getLong", "(", "TX_INFO_CACHE_WEIGHT", ",", "TX_INFO_CACHE_WEIGHT_DEFAULT", ")", ";", "if", "(", "size", "<=", "0", ")", "{", "th...
Gets the txinfo cache weight @param conf The FluoConfiguration @return The size of the cache value from the property value {@value #TX_INFO_CACHE_WEIGHT} if it is set, else the value of the default value {@value #TX_INFO_CACHE_WEIGHT_DEFAULT}
[ "Gets", "the", "txinfo", "cache", "weight" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java#L118-L124
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java
FluoConfigurationImpl.getVisibilityCacheWeight
public static long getVisibilityCacheWeight(FluoConfiguration conf) { long size = conf.getLong(VISIBILITY_CACHE_WEIGHT, VISIBILITY_CACHE_WEIGHT_DEFAULT); if (size <= 0) { throw new IllegalArgumentException( "Cache size must be positive for " + VISIBILITY_CACHE_WEIGHT); } return size; }
java
public static long getVisibilityCacheWeight(FluoConfiguration conf) { long size = conf.getLong(VISIBILITY_CACHE_WEIGHT, VISIBILITY_CACHE_WEIGHT_DEFAULT); if (size <= 0) { throw new IllegalArgumentException( "Cache size must be positive for " + VISIBILITY_CACHE_WEIGHT); } return size; }
[ "public", "static", "long", "getVisibilityCacheWeight", "(", "FluoConfiguration", "conf", ")", "{", "long", "size", "=", "conf", ".", "getLong", "(", "VISIBILITY_CACHE_WEIGHT", ",", "VISIBILITY_CACHE_WEIGHT_DEFAULT", ")", ";", "if", "(", "size", "<=", "0", ")", ...
Gets the visibility cache weight @param conf The FluoConfiguration @return The size of the cache value from the property value {@value #VISIBILITY_CACHE_WEIGHT} if it is set, else the value of the default value {@value #VISIBILITY_CACHE_WEIGHT_DEFAULT}
[ "Gets", "the", "visibility", "cache", "weight" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/FluoConfigurationImpl.java#L159-L166
train
apache/fluo
modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ZookeeperUtil.java
ZookeeperUtil.parseServers
public static String parseServers(String zookeepers) { int slashIndex = zookeepers.indexOf("/"); if (slashIndex != -1) { return zookeepers.substring(0, slashIndex); } return zookeepers; }
java
public static String parseServers(String zookeepers) { int slashIndex = zookeepers.indexOf("/"); if (slashIndex != -1) { return zookeepers.substring(0, slashIndex); } return zookeepers; }
[ "public", "static", "String", "parseServers", "(", "String", "zookeepers", ")", "{", "int", "slashIndex", "=", "zookeepers", ".", "indexOf", "(", "\"/\"", ")", ";", "if", "(", "slashIndex", "!=", "-", "1", ")", "{", "return", "zookeepers", ".", "substring"...
Parses server section of Zookeeper connection string
[ "Parses", "server", "section", "of", "Zookeeper", "connection", "string" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ZookeeperUtil.java#L41-L47
train
apache/fluo
modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ZookeeperUtil.java
ZookeeperUtil.parseRoot
public static String parseRoot(String zookeepers) { int slashIndex = zookeepers.indexOf("/"); if (slashIndex != -1) { return zookeepers.substring(slashIndex).trim(); } return "/"; }
java
public static String parseRoot(String zookeepers) { int slashIndex = zookeepers.indexOf("/"); if (slashIndex != -1) { return zookeepers.substring(slashIndex).trim(); } return "/"; }
[ "public", "static", "String", "parseRoot", "(", "String", "zookeepers", ")", "{", "int", "slashIndex", "=", "zookeepers", ".", "indexOf", "(", "\"/\"", ")", ";", "if", "(", "slashIndex", "!=", "-", "1", ")", "{", "return", "zookeepers", ".", "substring", ...
Parses chroot section of Zookeeper connection string @param zookeepers Zookeeper connection string @return Returns root path or "/" if none found
[ "Parses", "chroot", "section", "of", "Zookeeper", "connection", "string" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ZookeeperUtil.java#L55-L61
train
apache/fluo
modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ZookeeperUtil.java
ZookeeperUtil.getGcTimestamp
public static long getGcTimestamp(String zookeepers) { ZooKeeper zk = null; try { zk = new ZooKeeper(zookeepers, 30000, null); // wait until zookeeper is connected long start = System.currentTimeMillis(); while (!zk.getState().isConnected() && System.currentTimeMillis() - start < 30000)...
java
public static long getGcTimestamp(String zookeepers) { ZooKeeper zk = null; try { zk = new ZooKeeper(zookeepers, 30000, null); // wait until zookeeper is connected long start = System.currentTimeMillis(); while (!zk.getState().isConnected() && System.currentTimeMillis() - start < 30000)...
[ "public", "static", "long", "getGcTimestamp", "(", "String", "zookeepers", ")", "{", "ZooKeeper", "zk", "=", "null", ";", "try", "{", "zk", "=", "new", "ZooKeeper", "(", "zookeepers", ",", "30000", ",", "null", ")", ";", "// wait until zookeeper is connected",...
Retrieves the GC timestamp, set by the Oracle, from zookeeper @param zookeepers Zookeeper connection string @return Oldest active timestamp or oldest possible ts (-1) if not found
[ "Retrieves", "the", "GC", "timestamp", "set", "by", "the", "Oracle", "from", "zookeeper" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ZookeeperUtil.java#L69-L94
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/ByteUtil.java
ByteUtil.toBytes
public static Bytes toBytes(Text t) { return Bytes.of(t.getBytes(), 0, t.getLength()); }
java
public static Bytes toBytes(Text t) { return Bytes.of(t.getBytes(), 0, t.getLength()); }
[ "public", "static", "Bytes", "toBytes", "(", "Text", "t", ")", "{", "return", "Bytes", ".", "of", "(", "t", ".", "getBytes", "(", ")", ",", "0", ",", "t", ".", "getLength", "(", ")", ")", ";", "}" ]
Convert from Hadoop Text to Bytes
[ "Convert", "from", "Hadoop", "Text", "to", "Bytes" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/ByteUtil.java#L48-L50
train
apache/fluo
modules/mapreduce/src/main/java/org/apache/fluo/mapreduce/FluoEntryInputFormat.java
FluoEntryInputFormat.configure
public static void configure(Job conf, SimpleConfiguration config) { try { FluoConfiguration fconfig = new FluoConfiguration(config); try (Environment env = new Environment(fconfig)) { long ts = env.getSharedResources().getTimestampTracker().allocateTimestamp().getTxTimestamp(); ...
java
public static void configure(Job conf, SimpleConfiguration config) { try { FluoConfiguration fconfig = new FluoConfiguration(config); try (Environment env = new Environment(fconfig)) { long ts = env.getSharedResources().getTimestampTracker().allocateTimestamp().getTxTimestamp(); ...
[ "public", "static", "void", "configure", "(", "Job", "conf", ",", "SimpleConfiguration", "config", ")", "{", "try", "{", "FluoConfiguration", "fconfig", "=", "new", "FluoConfiguration", "(", "config", ")", ";", "try", "(", "Environment", "env", "=", "new", "...
Configure properties needed to connect to a Fluo application @param conf Job configuration @param config use {@link FluoConfiguration} to configure programmatically
[ "Configure", "properties", "needed", "to", "connect", "to", "a", "Fluo", "application" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/mapreduce/src/main/java/org/apache/fluo/mapreduce/FluoEntryInputFormat.java#L144-L167
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java
TransactionImpl.readUnread
private void readUnread(CommitData cd, Consumer<Entry<Key, Value>> locksSeen) { // TODO make async // TODO need to keep track of ranges read (not ranges passed in, but actual data read... user // may not iterate over entire range Map<Bytes, Set<Column>> columnsToRead = new HashMap<>(); for (Entry<B...
java
private void readUnread(CommitData cd, Consumer<Entry<Key, Value>> locksSeen) { // TODO make async // TODO need to keep track of ranges read (not ranges passed in, but actual data read... user // may not iterate over entire range Map<Bytes, Set<Column>> columnsToRead = new HashMap<>(); for (Entry<B...
[ "private", "void", "readUnread", "(", "CommitData", "cd", ",", "Consumer", "<", "Entry", "<", "Key", ",", "Value", ">", ">", "locksSeen", ")", "{", "// TODO make async", "// TODO need to keep track of ranges read (not ranges passed in, but actual data read... user", "// may...
This function helps handle the following case <OL> <LI>TX1 locls r1 col1 <LI>TX1 fails before unlocking <LI>TX2 attempts to write r1:col1 w/o reading it </OL> <p> In this case TX2 would not roll back TX1, because it never read the column. This function attempts to handle this case if TX2 fails. Only doing this in cas...
[ "This", "function", "helps", "handle", "the", "following", "case" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/TransactionImpl.java#L557-L579
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.byteAt
public byte byteAt(int i) { if (i < 0) { throw new IndexOutOfBoundsException("i < 0, " + i); } if (i >= length) { throw new IndexOutOfBoundsException("i >= length, " + i + " >= " + length); } return data[offset + i]; }
java
public byte byteAt(int i) { if (i < 0) { throw new IndexOutOfBoundsException("i < 0, " + i); } if (i >= length) { throw new IndexOutOfBoundsException("i >= length, " + i + " >= " + length); } return data[offset + i]; }
[ "public", "byte", "byteAt", "(", "int", "i", ")", "{", "if", "(", "i", "<", "0", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", "\"i < 0, \"", "+", "i", ")", ";", "}", "if", "(", "i", ">=", "length", ")", "{", "throw", "new", "IndexOut...
Gets a byte within this sequence of bytes @param i index into sequence @return byte @throws IllegalArgumentException if i is out of range
[ "Gets", "a", "byte", "within", "this", "sequence", "of", "bytes" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L103-L114
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.subSequence
public Bytes subSequence(int start, int end) { if (start > end || start < 0 || end > length) { throw new IndexOutOfBoundsException("Bad start and/end start = " + start + " end=" + end + " offset=" + offset + " length=" + length); } return new Bytes(data, offset + start, end - start); }
java
public Bytes subSequence(int start, int end) { if (start > end || start < 0 || end > length) { throw new IndexOutOfBoundsException("Bad start and/end start = " + start + " end=" + end + " offset=" + offset + " length=" + length); } return new Bytes(data, offset + start, end - start); }
[ "public", "Bytes", "subSequence", "(", "int", "start", ",", "int", "end", ")", "{", "if", "(", "start", ">", "end", "||", "start", "<", "0", "||", "end", ">", "length", ")", "{", "throw", "new", "IndexOutOfBoundsException", "(", "\"Bad start and/end start ...
Returns a portion of the Bytes object @param start index of subsequence start (inclusive) @param end index of subsequence end (exclusive)
[ "Returns", "a", "portion", "of", "the", "Bytes", "object" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L129-L135
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.toArray
public byte[] toArray() { byte[] copy = new byte[length]; System.arraycopy(data, offset, copy, 0, length); return copy; }
java
public byte[] toArray() { byte[] copy = new byte[length]; System.arraycopy(data, offset, copy, 0, length); return copy; }
[ "public", "byte", "[", "]", "toArray", "(", ")", "{", "byte", "[", "]", "copy", "=", "new", "byte", "[", "length", "]", ";", "System", ".", "arraycopy", "(", "data", ",", "offset", ",", "copy", ",", "0", ",", "length", ")", ";", "return", "copy",...
Returns a byte array containing a copy of the bytes
[ "Returns", "a", "byte", "array", "containing", "a", "copy", "of", "the", "bytes" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L140-L144
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.contentEquals
public boolean contentEquals(byte[] bytes, int offset, int len) { Preconditions.checkArgument(len >= 0 && offset >= 0 && offset + len <= bytes.length); return contentEqualsUnchecked(bytes, offset, len); }
java
public boolean contentEquals(byte[] bytes, int offset, int len) { Preconditions.checkArgument(len >= 0 && offset >= 0 && offset + len <= bytes.length); return contentEqualsUnchecked(bytes, offset, len); }
[ "public", "boolean", "contentEquals", "(", "byte", "[", "]", "bytes", ",", "int", "offset", ",", "int", "len", ")", "{", "Preconditions", ".", "checkArgument", "(", "len", ">=", "0", "&&", "offset", ">=", "0", "&&", "offset", "+", "len", "<=", "bytes",...
Returns true if this Bytes object equals another. This method checks it's arguments. @since 1.2.0
[ "Returns", "true", "if", "this", "Bytes", "object", "equals", "another", ".", "This", "method", "checks", "it", "s", "arguments", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L298-L301
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.contentEqualsUnchecked
private boolean contentEqualsUnchecked(byte[] bytes, int offset, int len) { if (length != len) { return false; } return compareToUnchecked(bytes, offset, len) == 0; }
java
private boolean contentEqualsUnchecked(byte[] bytes, int offset, int len) { if (length != len) { return false; } return compareToUnchecked(bytes, offset, len) == 0; }
[ "private", "boolean", "contentEqualsUnchecked", "(", "byte", "[", "]", "bytes", ",", "int", "offset", ",", "int", "len", ")", "{", "if", "(", "length", "!=", "len", ")", "{", "return", "false", ";", "}", "return", "compareToUnchecked", "(", "bytes", ",",...
Returns true if this Bytes object equals another. This method doesn't check it's arguments. @since 1.2.0
[ "Returns", "true", "if", "this", "Bytes", "object", "equals", "another", ".", "This", "method", "doesn", "t", "check", "it", "s", "arguments", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L308-L314
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.of
public static final Bytes of(byte[] array) { Objects.requireNonNull(array); if (array.length == 0) { return EMPTY; } byte[] copy = new byte[array.length]; System.arraycopy(array, 0, copy, 0, array.length); return new Bytes(copy); }
java
public static final Bytes of(byte[] array) { Objects.requireNonNull(array); if (array.length == 0) { return EMPTY; } byte[] copy = new byte[array.length]; System.arraycopy(array, 0, copy, 0, array.length); return new Bytes(copy); }
[ "public", "static", "final", "Bytes", "of", "(", "byte", "[", "]", "array", ")", "{", "Objects", ".", "requireNonNull", "(", "array", ")", ";", "if", "(", "array", ".", "length", "==", "0", ")", "{", "return", "EMPTY", ";", "}", "byte", "[", "]", ...
Creates a Bytes object by copying the data of the given byte array
[ "Creates", "a", "Bytes", "object", "by", "copying", "the", "data", "of", "the", "given", "byte", "array" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L332-L340
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.of
public static final Bytes of(byte[] data, int offset, int length) { Objects.requireNonNull(data); if (length == 0) { return EMPTY; } byte[] copy = new byte[length]; System.arraycopy(data, offset, copy, 0, length); return new Bytes(copy); }
java
public static final Bytes of(byte[] data, int offset, int length) { Objects.requireNonNull(data); if (length == 0) { return EMPTY; } byte[] copy = new byte[length]; System.arraycopy(data, offset, copy, 0, length); return new Bytes(copy); }
[ "public", "static", "final", "Bytes", "of", "(", "byte", "[", "]", "data", ",", "int", "offset", ",", "int", "length", ")", "{", "Objects", ".", "requireNonNull", "(", "data", ")", ";", "if", "(", "length", "==", "0", ")", "{", "return", "EMPTY", "...
Creates a Bytes object by copying the data of a subsequence of the given byte array @param data Byte data @param offset Starting offset in byte array (inclusive) @param length Number of bytes to include
[ "Creates", "a", "Bytes", "object", "by", "copying", "the", "data", "of", "a", "subsequence", "of", "the", "given", "byte", "array" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L349-L357
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.of
public static final Bytes of(ByteBuffer bb) { Objects.requireNonNull(bb); if (bb.remaining() == 0) { return EMPTY; } byte[] data; if (bb.hasArray()) { data = Arrays.copyOfRange(bb.array(), bb.position() + bb.arrayOffset(), bb.limit() + bb.arrayOffset()); } else { data...
java
public static final Bytes of(ByteBuffer bb) { Objects.requireNonNull(bb); if (bb.remaining() == 0) { return EMPTY; } byte[] data; if (bb.hasArray()) { data = Arrays.copyOfRange(bb.array(), bb.position() + bb.arrayOffset(), bb.limit() + bb.arrayOffset()); } else { data...
[ "public", "static", "final", "Bytes", "of", "(", "ByteBuffer", "bb", ")", "{", "Objects", ".", "requireNonNull", "(", "bb", ")", ";", "if", "(", "bb", ".", "remaining", "(", ")", "==", "0", ")", "{", "return", "EMPTY", ";", "}", "byte", "[", "]", ...
Creates a Bytes object by copying the data of the given ByteBuffer. @param bb Data will be read from this ByteBuffer in such a way that its position is not changed.
[ "Creates", "a", "Bytes", "object", "by", "copying", "the", "data", "of", "the", "given", "ByteBuffer", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L365-L380
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.of
public static final Bytes of(CharSequence cs) { if (cs instanceof String) { return of((String) cs); } Objects.requireNonNull(cs); if (cs.length() == 0) { return EMPTY; } ByteBuffer bb = StandardCharsets.UTF_8.encode(CharBuffer.wrap(cs)); if (bb.hasArray()) { // this byte...
java
public static final Bytes of(CharSequence cs) { if (cs instanceof String) { return of((String) cs); } Objects.requireNonNull(cs); if (cs.length() == 0) { return EMPTY; } ByteBuffer bb = StandardCharsets.UTF_8.encode(CharBuffer.wrap(cs)); if (bb.hasArray()) { // this byte...
[ "public", "static", "final", "Bytes", "of", "(", "CharSequence", "cs", ")", "{", "if", "(", "cs", "instanceof", "String", ")", "{", "return", "of", "(", "(", "String", ")", "cs", ")", ";", "}", "Objects", ".", "requireNonNull", "(", "cs", ")", ";", ...
Creates a Bytes object by copying the data of the CharSequence and encoding it using UTF-8.
[ "Creates", "a", "Bytes", "object", "by", "copying", "the", "data", "of", "the", "CharSequence", "and", "encoding", "it", "using", "UTF", "-", "8", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L385-L405
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.of
public static final Bytes of(String s) { Objects.requireNonNull(s); if (s.isEmpty()) { return EMPTY; } byte[] data = s.getBytes(StandardCharsets.UTF_8); return new Bytes(data, s); }
java
public static final Bytes of(String s) { Objects.requireNonNull(s); if (s.isEmpty()) { return EMPTY; } byte[] data = s.getBytes(StandardCharsets.UTF_8); return new Bytes(data, s); }
[ "public", "static", "final", "Bytes", "of", "(", "String", "s", ")", "{", "Objects", ".", "requireNonNull", "(", "s", ")", ";", "if", "(", "s", ".", "isEmpty", "(", ")", ")", "{", "return", "EMPTY", ";", "}", "byte", "[", "]", "data", "=", "s", ...
Creates a Bytes object by copying the value of the given String
[ "Creates", "a", "Bytes", "object", "by", "copying", "the", "value", "of", "the", "given", "String" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L410-L417
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.of
public static final Bytes of(String s, Charset c) { Objects.requireNonNull(s); Objects.requireNonNull(c); if (s.isEmpty()) { return EMPTY; } byte[] data = s.getBytes(c); return new Bytes(data); }
java
public static final Bytes of(String s, Charset c) { Objects.requireNonNull(s); Objects.requireNonNull(c); if (s.isEmpty()) { return EMPTY; } byte[] data = s.getBytes(c); return new Bytes(data); }
[ "public", "static", "final", "Bytes", "of", "(", "String", "s", ",", "Charset", "c", ")", "{", "Objects", ".", "requireNonNull", "(", "s", ")", ";", "Objects", ".", "requireNonNull", "(", "c", ")", ";", "if", "(", "s", ".", "isEmpty", "(", ")", ")"...
Creates a Bytes object by copying the value of the given String with a given charset
[ "Creates", "a", "Bytes", "object", "by", "copying", "the", "value", "of", "the", "given", "String", "with", "a", "given", "charset" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L422-L430
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.startsWith
public boolean startsWith(Bytes prefix) { Objects.requireNonNull(prefix, "startWith(Bytes prefix) cannot have null parameter"); if (prefix.length > this.length) { return false; } else { int end = this.offset + prefix.length; for (int i = this.offset, j = prefix.offset; i < end; i++, j++) ...
java
public boolean startsWith(Bytes prefix) { Objects.requireNonNull(prefix, "startWith(Bytes prefix) cannot have null parameter"); if (prefix.length > this.length) { return false; } else { int end = this.offset + prefix.length; for (int i = this.offset, j = prefix.offset; i < end; i++, j++) ...
[ "public", "boolean", "startsWith", "(", "Bytes", "prefix", ")", "{", "Objects", ".", "requireNonNull", "(", "prefix", ",", "\"startWith(Bytes prefix) cannot have null parameter\"", ")", ";", "if", "(", "prefix", ".", "length", ">", "this", ".", "length", ")", "{...
Checks if this has the passed prefix @param prefix is a Bytes object to compare to this @return true or false @since 1.1.0
[ "Checks", "if", "this", "has", "the", "passed", "prefix" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L439-L453
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.endsWith
public boolean endsWith(Bytes suffix) { Objects.requireNonNull(suffix, "endsWith(Bytes suffix) cannot have null parameter"); int startOffset = this.length - suffix.length; if (startOffset < 0) { return false; } else { int end = startOffset + this.offset + suffix.length; for (int i = s...
java
public boolean endsWith(Bytes suffix) { Objects.requireNonNull(suffix, "endsWith(Bytes suffix) cannot have null parameter"); int startOffset = this.length - suffix.length; if (startOffset < 0) { return false; } else { int end = startOffset + this.offset + suffix.length; for (int i = s...
[ "public", "boolean", "endsWith", "(", "Bytes", "suffix", ")", "{", "Objects", ".", "requireNonNull", "(", "suffix", ",", "\"endsWith(Bytes suffix) cannot have null parameter\"", ")", ";", "int", "startOffset", "=", "this", ".", "length", "-", "suffix", ".", "lengt...
Checks if this has the passed suffix @param suffix is a Bytes object to compare to this @return true or false @since 1.1.0
[ "Checks", "if", "this", "has", "the", "passed", "suffix" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L462-L477
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java
Bytes.copyTo
public void copyTo(int start, int end, byte[] dest, int destPos) { // this.subSequence(start, end).copyTo(dest, destPos) would allocate another Bytes object arraycopy(start, dest, destPos, end - start); }
java
public void copyTo(int start, int end, byte[] dest, int destPos) { // this.subSequence(start, end).copyTo(dest, destPos) would allocate another Bytes object arraycopy(start, dest, destPos, end - start); }
[ "public", "void", "copyTo", "(", "int", "start", ",", "int", "end", ",", "byte", "[", "]", "dest", ",", "int", "destPos", ")", "{", "// this.subSequence(start, end).copyTo(dest, destPos) would allocate another Bytes object", "arraycopy", "(", "start", ",", "dest", "...
Copy a subsequence of Bytes to specific byte array. Uses the specified offset in the dest byte array to start the copy. @param start index of subsequence start (inclusive) @param end index of subsequence end (exclusive) @param dest destination array @param destPos starting position in the destination data. @exception ...
[ "Copy", "a", "subsequence", "of", "Bytes", "to", "specific", "byte", "array", ".", "Uses", "the", "specified", "offset", "in", "the", "dest", "byte", "array", "to", "start", "the", "copy", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/Bytes.java#L674-L677
train
apache/fluo
modules/accumulo/src/main/java/org/apache/fluo/accumulo/iterators/ColumnBuffer.java
ColumnBuffer.copyTo
public void copyTo(ColumnBuffer dest, LongPredicate timestampTest) { dest.clear(); if (key != null) { dest.key = new Key(key); } for (int i = 0; i < timeStamps.size(); i++) { long time = timeStamps.get(i); if (timestampTest.test(time)) { dest.add(time, values.get(i)); }...
java
public void copyTo(ColumnBuffer dest, LongPredicate timestampTest) { dest.clear(); if (key != null) { dest.key = new Key(key); } for (int i = 0; i < timeStamps.size(); i++) { long time = timeStamps.get(i); if (timestampTest.test(time)) { dest.add(time, values.get(i)); }...
[ "public", "void", "copyTo", "(", "ColumnBuffer", "dest", ",", "LongPredicate", "timestampTest", ")", "{", "dest", ".", "clear", "(", ")", ";", "if", "(", "key", "!=", "null", ")", "{", "dest", ".", "key", "=", "new", "Key", "(", "key", ")", ";", "}...
Clears the dest ColumnBuffer and inserts all entries in dest where the timestamp passes the timestampTest. @param dest Destination ColumnBuffer @param timestampTest Test to determine which timestamps get added to dest
[ "Clears", "the", "dest", "ColumnBuffer", "and", "inserts", "all", "entries", "in", "dest", "where", "the", "timestamp", "passes", "the", "timestampTest", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/iterators/ColumnBuffer.java#L91-L104
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/AccumuloUtil.java
AccumuloUtil.getClient
public static AccumuloClient getClient(FluoConfiguration config) { return Accumulo.newClient().to(config.getAccumuloInstance(), config.getAccumuloZookeepers()) .as(config.getAccumuloUser(), config.getAccumuloPassword()).build(); }
java
public static AccumuloClient getClient(FluoConfiguration config) { return Accumulo.newClient().to(config.getAccumuloInstance(), config.getAccumuloZookeepers()) .as(config.getAccumuloUser(), config.getAccumuloPassword()).build(); }
[ "public", "static", "AccumuloClient", "getClient", "(", "FluoConfiguration", "config", ")", "{", "return", "Accumulo", ".", "newClient", "(", ")", ".", "to", "(", "config", ".", "getAccumuloInstance", "(", ")", ",", "config", ".", "getAccumuloZookeepers", "(", ...
Creates Accumulo connector given FluoConfiguration
[ "Creates", "Accumulo", "connector", "given", "FluoConfiguration" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/AccumuloUtil.java#L31-L34
train
apache/fluo
modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ByteArrayUtil.java
ByteArrayUtil.encode
public static byte[] encode(byte[] ba, int offset, long v) { ba[offset + 0] = (byte) (v >>> 56); ba[offset + 1] = (byte) (v >>> 48); ba[offset + 2] = (byte) (v >>> 40); ba[offset + 3] = (byte) (v >>> 32); ba[offset + 4] = (byte) (v >>> 24); ba[offset + 5] = (byte) (v >>> 16); ba[offset + 6] ...
java
public static byte[] encode(byte[] ba, int offset, long v) { ba[offset + 0] = (byte) (v >>> 56); ba[offset + 1] = (byte) (v >>> 48); ba[offset + 2] = (byte) (v >>> 40); ba[offset + 3] = (byte) (v >>> 32); ba[offset + 4] = (byte) (v >>> 24); ba[offset + 5] = (byte) (v >>> 16); ba[offset + 6] ...
[ "public", "static", "byte", "[", "]", "encode", "(", "byte", "[", "]", "ba", ",", "int", "offset", ",", "long", "v", ")", "{", "ba", "[", "offset", "+", "0", "]", "=", "(", "byte", ")", "(", "v", ">>>", "56", ")", ";", "ba", "[", "offset", ...
Encode a long into a byte array at an offset @param ba Byte array @param offset Offset @param v Long value @return byte array given in input
[ "Encode", "a", "long", "into", "a", "byte", "array", "at", "an", "offset" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ByteArrayUtil.java#L57-L67
train
apache/fluo
modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ByteArrayUtil.java
ByteArrayUtil.decodeLong
public static long decodeLong(byte[] ba, int offset) { return ((((long) ba[offset + 0] << 56) + ((long) (ba[offset + 1] & 255) << 48) + ((long) (ba[offset + 2] & 255) << 40) + ((long) (ba[offset + 3] & 255) << 32) + ((long) (ba[offset + 4] & 255) << 24) + ((ba[offset + 5] & 255) << 16) + ((b...
java
public static long decodeLong(byte[] ba, int offset) { return ((((long) ba[offset + 0] << 56) + ((long) (ba[offset + 1] & 255) << 48) + ((long) (ba[offset + 2] & 255) << 40) + ((long) (ba[offset + 3] & 255) << 32) + ((long) (ba[offset + 4] & 255) << 24) + ((ba[offset + 5] & 255) << 16) + ((b...
[ "public", "static", "long", "decodeLong", "(", "byte", "[", "]", "ba", ",", "int", "offset", ")", "{", "return", "(", "(", "(", "(", "long", ")", "ba", "[", "offset", "+", "0", "]", "<<", "56", ")", "+", "(", "(", "long", ")", "(", "ba", "[",...
Decode long from byte array at offset @param ba byte array @param offset Offset @return long value
[ "Decode", "long", "from", "byte", "array", "at", "offset" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ByteArrayUtil.java#L76-L81
train
apache/fluo
modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ByteArrayUtil.java
ByteArrayUtil.concat
public static byte[] concat(Bytes... listOfBytes) { int offset = 0; int size = 0; for (Bytes b : listOfBytes) { size += b.length() + checkVlen(b.length()); } byte[] data = new byte[size]; for (Bytes b : listOfBytes) { offset = writeVint(data, offset, b.length()); b.copyTo(0, ...
java
public static byte[] concat(Bytes... listOfBytes) { int offset = 0; int size = 0; for (Bytes b : listOfBytes) { size += b.length() + checkVlen(b.length()); } byte[] data = new byte[size]; for (Bytes b : listOfBytes) { offset = writeVint(data, offset, b.length()); b.copyTo(0, ...
[ "public", "static", "byte", "[", "]", "concat", "(", "Bytes", "...", "listOfBytes", ")", "{", "int", "offset", "=", "0", ";", "int", "size", "=", "0", ";", "for", "(", "Bytes", "b", ":", "listOfBytes", ")", "{", "size", "+=", "b", ".", "length", ...
Concatenates of list of Bytes objects to create a byte array @param listOfBytes Bytes objects to concatenate @return Bytes
[ "Concatenates", "of", "list", "of", "Bytes", "objects", "to", "create", "a", "byte", "array" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ByteArrayUtil.java#L120-L135
train
apache/fluo
modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ByteArrayUtil.java
ByteArrayUtil.writeVint
public static int writeVint(byte[] dest, int offset, int i) { if (i >= -112 && i <= 127) { dest[offset++] = (byte) i; } else { int len = -112; if (i < 0) { i ^= -1L; // take one's complement' len = -120; } long tmp = i; while (tmp != 0) { tmp = tmp >>...
java
public static int writeVint(byte[] dest, int offset, int i) { if (i >= -112 && i <= 127) { dest[offset++] = (byte) i; } else { int len = -112; if (i < 0) { i ^= -1L; // take one's complement' len = -120; } long tmp = i; while (tmp != 0) { tmp = tmp >>...
[ "public", "static", "int", "writeVint", "(", "byte", "[", "]", "dest", ",", "int", "offset", ",", "int", "i", ")", "{", "if", "(", "i", ">=", "-", "112", "&&", "i", "<=", "127", ")", "{", "dest", "[", "offset", "++", "]", "=", "(", "byte", ")...
Writes a vInt directly to a byte array @param dest The destination array for the vInt to be written to @param offset The location where to write the vInt to @param i The Value being written into byte array @return Returns the new offset location
[ "Writes", "a", "vInt", "directly", "to", "a", "byte", "array" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ByteArrayUtil.java#L145-L173
train
apache/fluo
modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ByteArrayUtil.java
ByteArrayUtil.checkVlen
public static int checkVlen(int i) { int count = 0; if (i >= -112 && i <= 127) { return 1; } else { int len = -112; if (i < 0) { i ^= -1L; // take one's complement' len = -120; } long tmp = i; while (tmp != 0) { tmp = tmp >> 8; len--; ...
java
public static int checkVlen(int i) { int count = 0; if (i >= -112 && i <= 127) { return 1; } else { int len = -112; if (i < 0) { i ^= -1L; // take one's complement' len = -120; } long tmp = i; while (tmp != 0) { tmp = tmp >> 8; len--; ...
[ "public", "static", "int", "checkVlen", "(", "int", "i", ")", "{", "int", "count", "=", "0", ";", "if", "(", "i", ">=", "-", "112", "&&", "i", "<=", "127", ")", "{", "return", "1", ";", "}", "else", "{", "int", "len", "=", "-", "112", ";", ...
Determines the number bytes required to store a variable length @param i length of Bytes @return number of bytes needed
[ "Determines", "the", "number", "bytes", "required", "to", "store", "a", "variable", "length" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/accumulo/src/main/java/org/apache/fluo/accumulo/util/ByteArrayUtil.java#L181-L209
train
apache/fluo
modules/cluster/src/main/java/org/apache/fluo/cluster/runner/YarnAppRunner.java
YarnAppRunner.getResourceReport
private ResourceReport getResourceReport(TwillController controller, int maxWaitMs) { ResourceReport report = controller.getResourceReport(); int elapsed = 0; while (report == null) { report = controller.getResourceReport(); try { Thread.sleep(500); } catch (InterruptedException e)...
java
private ResourceReport getResourceReport(TwillController controller, int maxWaitMs) { ResourceReport report = controller.getResourceReport(); int elapsed = 0; while (report == null) { report = controller.getResourceReport(); try { Thread.sleep(500); } catch (InterruptedException e)...
[ "private", "ResourceReport", "getResourceReport", "(", "TwillController", "controller", ",", "int", "maxWaitMs", ")", "{", "ResourceReport", "report", "=", "controller", ".", "getResourceReport", "(", ")", ";", "int", "elapsed", "=", "0", ";", "while", "(", "rep...
Attempts to retrieves ResourceReport until maxWaitMs time is reached. Set maxWaitMs to -1 to retry forever.
[ "Attempts", "to", "retrieves", "ResourceReport", "until", "maxWaitMs", "time", "is", "reached", ".", "Set", "maxWaitMs", "to", "-", "1", "to", "retry", "forever", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/cluster/src/main/java/org/apache/fluo/cluster/runner/YarnAppRunner.java#L290-L312
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java
FluoConfiguration.verifyApplicationName
private void verifyApplicationName(String name) { if (name == null) { throw new IllegalArgumentException("Application name cannot be null"); } if (name.isEmpty()) { throw new IllegalArgumentException("Application name length must be > 0"); } String reason = null; char[] chars = name....
java
private void verifyApplicationName(String name) { if (name == null) { throw new IllegalArgumentException("Application name cannot be null"); } if (name.isEmpty()) { throw new IllegalArgumentException("Application name length must be > 0"); } String reason = null; char[] chars = name....
[ "private", "void", "verifyApplicationName", "(", "String", "name", ")", "{", "if", "(", "name", "==", "null", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Application name cannot be null\"", ")", ";", "}", "if", "(", "name", ".", "isEmpty", "(...
Verifies application name. Avoids characters that Zookeeper does not like in nodes & Hadoop does not like in HDFS paths. @param name Application name @throws IllegalArgumentException If name contains illegal characters
[ "Verifies", "application", "name", ".", "Avoids", "characters", "that", "Zookeeper", "does", "not", "like", "in", "nodes", "&", "Hadoop", "does", "not", "like", "in", "HDFS", "paths", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L318-L346
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java
FluoConfiguration.addObservers
@Deprecated public FluoConfiguration addObservers(Iterable<ObserverSpecification> observers) { int next = getNextObserverId(); for (ObserverSpecification oconf : observers) { addObserver(oconf, next++); } return this; }
java
@Deprecated public FluoConfiguration addObservers(Iterable<ObserverSpecification> observers) { int next = getNextObserverId(); for (ObserverSpecification oconf : observers) { addObserver(oconf, next++); } return this; }
[ "@", "Deprecated", "public", "FluoConfiguration", "addObservers", "(", "Iterable", "<", "ObserverSpecification", ">", "observers", ")", "{", "int", "next", "=", "getNextObserverId", "(", ")", ";", "for", "(", "ObserverSpecification", "oconf", ":", "observers", ")"...
Adds multiple observers using unique integer prefixes for each. @deprecated since 1.1.0. Replaced by {@link #setObserverProvider(String)} and {@link #getObserverProvider()}
[ "Adds", "multiple", "observers", "using", "unique", "integer", "prefixes", "for", "each", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L819-L826
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java
FluoConfiguration.clearObservers
@Deprecated public FluoConfiguration clearObservers() { Iterator<String> iter1 = getKeys(OBSERVER_PREFIX.substring(0, OBSERVER_PREFIX.length() - 1)); while (iter1.hasNext()) { String key = iter1.next(); clearProperty(key); } return this; }
java
@Deprecated public FluoConfiguration clearObservers() { Iterator<String> iter1 = getKeys(OBSERVER_PREFIX.substring(0, OBSERVER_PREFIX.length() - 1)); while (iter1.hasNext()) { String key = iter1.next(); clearProperty(key); } return this; }
[ "@", "Deprecated", "public", "FluoConfiguration", "clearObservers", "(", ")", "{", "Iterator", "<", "String", ">", "iter1", "=", "getKeys", "(", "OBSERVER_PREFIX", ".", "substring", "(", "0", ",", "OBSERVER_PREFIX", ".", "length", "(", ")", "-", "1", ")", ...
Removes any configured observers. @deprecated since 1.1.0. Replaced by {@link #setObserverProvider(String)} and {@link #getObserverProvider()}
[ "Removes", "any", "configured", "observers", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L834-L843
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java
FluoConfiguration.print
public void print() { Iterator<String> iter = getKeys(); while (iter.hasNext()) { String key = iter.next(); log.info(key + " = " + getRawString(key)); } }
java
public void print() { Iterator<String> iter = getKeys(); while (iter.hasNext()) { String key = iter.next(); log.info(key + " = " + getRawString(key)); } }
[ "public", "void", "print", "(", ")", "{", "Iterator", "<", "String", ">", "iter", "=", "getKeys", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "String", "key", "=", "iter", ".", "next", "(", ")", ";", "log", ".", "in...
Logs all properties
[ "Logs", "all", "properties" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L976-L982
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java
FluoConfiguration.hasRequiredClientProps
public boolean hasRequiredClientProps() { boolean valid = true; valid &= verifyStringPropSet(CONNECTION_APPLICATION_NAME_PROP, CLIENT_APPLICATION_NAME_PROP); valid &= verifyStringPropSet(ACCUMULO_USER_PROP, CLIENT_ACCUMULO_USER_PROP); valid &= verifyStringPropSet(ACCUMULO_PASSWORD_PROP, CLIENT_ACCUMULO_...
java
public boolean hasRequiredClientProps() { boolean valid = true; valid &= verifyStringPropSet(CONNECTION_APPLICATION_NAME_PROP, CLIENT_APPLICATION_NAME_PROP); valid &= verifyStringPropSet(ACCUMULO_USER_PROP, CLIENT_ACCUMULO_USER_PROP); valid &= verifyStringPropSet(ACCUMULO_PASSWORD_PROP, CLIENT_ACCUMULO_...
[ "public", "boolean", "hasRequiredClientProps", "(", ")", "{", "boolean", "valid", "=", "true", ";", "valid", "&=", "verifyStringPropSet", "(", "CONNECTION_APPLICATION_NAME_PROP", ",", "CLIENT_APPLICATION_NAME_PROP", ")", ";", "valid", "&=", "verifyStringPropSet", "(", ...
Returns true if required properties for FluoClient are set
[ "Returns", "true", "if", "required", "properties", "for", "FluoClient", "are", "set" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L1018-L1025
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java
FluoConfiguration.hasRequiredAdminProps
public boolean hasRequiredAdminProps() { boolean valid = true; valid &= hasRequiredClientProps(); valid &= verifyStringPropSet(ACCUMULO_TABLE_PROP, ADMIN_ACCUMULO_TABLE_PROP); return valid; }
java
public boolean hasRequiredAdminProps() { boolean valid = true; valid &= hasRequiredClientProps(); valid &= verifyStringPropSet(ACCUMULO_TABLE_PROP, ADMIN_ACCUMULO_TABLE_PROP); return valid; }
[ "public", "boolean", "hasRequiredAdminProps", "(", ")", "{", "boolean", "valid", "=", "true", ";", "valid", "&=", "hasRequiredClientProps", "(", ")", ";", "valid", "&=", "verifyStringPropSet", "(", "ACCUMULO_TABLE_PROP", ",", "ADMIN_ACCUMULO_TABLE_PROP", ")", ";", ...
Returns true if required properties for FluoAdmin are set
[ "Returns", "true", "if", "required", "properties", "for", "FluoAdmin", "are", "set" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L1030-L1035
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java
FluoConfiguration.hasRequiredMiniFluoProps
public boolean hasRequiredMiniFluoProps() { boolean valid = true; if (getMiniStartAccumulo()) { // ensure that client properties are not set since we are using MiniAccumulo valid &= verifyStringPropNotSet(ACCUMULO_USER_PROP, CLIENT_ACCUMULO_USER_PROP); valid &= verifyStringPropNotSet(ACCUMULO_...
java
public boolean hasRequiredMiniFluoProps() { boolean valid = true; if (getMiniStartAccumulo()) { // ensure that client properties are not set since we are using MiniAccumulo valid &= verifyStringPropNotSet(ACCUMULO_USER_PROP, CLIENT_ACCUMULO_USER_PROP); valid &= verifyStringPropNotSet(ACCUMULO_...
[ "public", "boolean", "hasRequiredMiniFluoProps", "(", ")", "{", "boolean", "valid", "=", "true", ";", "if", "(", "getMiniStartAccumulo", "(", ")", ")", "{", "// ensure that client properties are not set since we are using MiniAccumulo", "valid", "&=", "verifyStringPropNotSe...
Returns true if required properties for MiniFluo are set
[ "Returns", "true", "if", "required", "properties", "for", "MiniFluo", "are", "set" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L1058-L1079
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java
FluoConfiguration.getClientConfiguration
public SimpleConfiguration getClientConfiguration() { SimpleConfiguration clientConfig = new SimpleConfiguration(); Iterator<String> iter = getKeys(); while (iter.hasNext()) { String key = iter.next(); if (key.startsWith(CONNECTION_PREFIX) || key.startsWith(ACCUMULO_PREFIX) || key.star...
java
public SimpleConfiguration getClientConfiguration() { SimpleConfiguration clientConfig = new SimpleConfiguration(); Iterator<String> iter = getKeys(); while (iter.hasNext()) { String key = iter.next(); if (key.startsWith(CONNECTION_PREFIX) || key.startsWith(ACCUMULO_PREFIX) || key.star...
[ "public", "SimpleConfiguration", "getClientConfiguration", "(", ")", "{", "SimpleConfiguration", "clientConfig", "=", "new", "SimpleConfiguration", "(", ")", ";", "Iterator", "<", "String", ">", "iter", "=", "getKeys", "(", ")", ";", "while", "(", "iter", ".", ...
Returns a SimpleConfiguration clientConfig with properties set from this configuration @return SimpleConfiguration
[ "Returns", "a", "SimpleConfiguration", "clientConfig", "with", "properties", "set", "from", "this", "configuration" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L1086-L1097
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java
FluoConfiguration.setDefaultConfiguration
public static void setDefaultConfiguration(SimpleConfiguration config) { config.setProperty(CONNECTION_ZOOKEEPERS_PROP, CONNECTION_ZOOKEEPERS_DEFAULT); config.setProperty(CONNECTION_ZOOKEEPER_TIMEOUT_PROP, CONNECTION_ZOOKEEPER_TIMEOUT_DEFAULT); config.setProperty(DFS_ROOT_PROP, DFS_ROOT_DEFAULT); config...
java
public static void setDefaultConfiguration(SimpleConfiguration config) { config.setProperty(CONNECTION_ZOOKEEPERS_PROP, CONNECTION_ZOOKEEPERS_DEFAULT); config.setProperty(CONNECTION_ZOOKEEPER_TIMEOUT_PROP, CONNECTION_ZOOKEEPER_TIMEOUT_DEFAULT); config.setProperty(DFS_ROOT_PROP, DFS_ROOT_DEFAULT); config...
[ "public", "static", "void", "setDefaultConfiguration", "(", "SimpleConfiguration", "config", ")", "{", "config", ".", "setProperty", "(", "CONNECTION_ZOOKEEPERS_PROP", ",", "CONNECTION_ZOOKEEPERS_DEFAULT", ")", ";", "config", ".", "setProperty", "(", "CONNECTION_ZOOKEEPER...
Sets all Fluo properties to their default in the given configuration. NOTE - some properties do not have defaults and will not be set.
[ "Sets", "all", "Fluo", "properties", "to", "their", "default", "in", "the", "given", "configuration", ".", "NOTE", "-", "some", "properties", "do", "not", "have", "defaults", "and", "will", "not", "be", "set", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/config/FluoConfiguration.java#L1113-L1124
train
apache/fluo
modules/mapreduce/src/main/java/org/apache/fluo/mapreduce/FluoOutputFormat.java
FluoOutputFormat.configure
public static void configure(Job conf, SimpleConfiguration props) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); props.save(baos); conf.getConfiguration().set(PROPS_CONF_KEY, new String(baos.toByteArray(), StandardCharsets.UTF_8)); } catch (Exception e) { ...
java
public static void configure(Job conf, SimpleConfiguration props) { try { ByteArrayOutputStream baos = new ByteArrayOutputStream(); props.save(baos); conf.getConfiguration().set(PROPS_CONF_KEY, new String(baos.toByteArray(), StandardCharsets.UTF_8)); } catch (Exception e) { ...
[ "public", "static", "void", "configure", "(", "Job", "conf", ",", "SimpleConfiguration", "props", ")", "{", "try", "{", "ByteArrayOutputStream", "baos", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "props", ".", "save", "(", "baos", ")", ";", "conf", ...
Call this method to initialize the Fluo connection props @param conf Job configuration @param props Use {@link org.apache.fluo.api.config.FluoConfiguration} to set props programmatically
[ "Call", "this", "method", "to", "initialize", "the", "Fluo", "connection", "props" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/mapreduce/src/main/java/org/apache/fluo/mapreduce/FluoOutputFormat.java#L118-L130
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/impl/TimestampTracker.java
TimestampTracker.allocateTimestamp
public Stamp allocateTimestamp() { synchronized (this) { Preconditions.checkState(!closed, "tracker closed "); if (node == null) { Preconditions.checkState(allocationsInProgress == 0, "expected allocationsInProgress == 0 when node == null"); Preconditions.checkState(!updati...
java
public Stamp allocateTimestamp() { synchronized (this) { Preconditions.checkState(!closed, "tracker closed "); if (node == null) { Preconditions.checkState(allocationsInProgress == 0, "expected allocationsInProgress == 0 when node == null"); Preconditions.checkState(!updati...
[ "public", "Stamp", "allocateTimestamp", "(", ")", "{", "synchronized", "(", "this", ")", "{", "Preconditions", ".", "checkState", "(", "!", "closed", ",", "\"tracker closed \"", ")", ";", "if", "(", "node", "==", "null", ")", "{", "Preconditions", ".", "ch...
Allocate a timestamp
[ "Allocate", "a", "timestamp" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/TimestampTracker.java#L125-L155
train
apache/fluo
modules/command/src/main/java/org/apache/fluo/command/FluoWait.java
FluoWait.waitTillNoNotifications
private static boolean waitTillNoNotifications(Environment env, TableRange range) throws TableNotFoundException { boolean sawNotifications = false; long retryTime = MIN_SLEEP_MS; log.debug("Scanning tablet {} for notifications", range); long start = System.currentTimeMillis(); while (hasNoti...
java
private static boolean waitTillNoNotifications(Environment env, TableRange range) throws TableNotFoundException { boolean sawNotifications = false; long retryTime = MIN_SLEEP_MS; log.debug("Scanning tablet {} for notifications", range); long start = System.currentTimeMillis(); while (hasNoti...
[ "private", "static", "boolean", "waitTillNoNotifications", "(", "Environment", "env", ",", "TableRange", "range", ")", "throws", "TableNotFoundException", "{", "boolean", "sawNotifications", "=", "false", ";", "long", "retryTime", "=", "MIN_SLEEP_MS", ";", "log", "....
Wait until a range has no notifications. @return true if notifications were ever seen while waiting
[ "Wait", "until", "a", "range", "has", "no", "notifications", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/command/src/main/java/org/apache/fluo/command/FluoWait.java#L66-L84
train
apache/fluo
modules/command/src/main/java/org/apache/fluo/command/FluoWait.java
FluoWait.waitUntilFinished
private static void waitUntilFinished(FluoConfiguration config) { try (Environment env = new Environment(config)) { List<TableRange> ranges = getRanges(env); outer: while (true) { long ts1 = env.getSharedResources().getOracleClient().getStamp().getTxTimestamp(); for (TableRange range : ...
java
private static void waitUntilFinished(FluoConfiguration config) { try (Environment env = new Environment(config)) { List<TableRange> ranges = getRanges(env); outer: while (true) { long ts1 = env.getSharedResources().getOracleClient().getStamp().getTxTimestamp(); for (TableRange range : ...
[ "private", "static", "void", "waitUntilFinished", "(", "FluoConfiguration", "config", ")", "{", "try", "(", "Environment", "env", "=", "new", "Environment", "(", "config", ")", ")", "{", "List", "<", "TableRange", ">", "ranges", "=", "getRanges", "(", "env",...
Wait until a scan of the table completes without seeing notifications AND without the Oracle issuing any timestamps during the scan.
[ "Wait", "until", "a", "scan", "of", "the", "table", "completes", "without", "seeing", "notifications", "AND", "without", "the", "Oracle", "issuing", "any", "timestamps", "during", "the", "scan", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/command/src/main/java/org/apache/fluo/command/FluoWait.java#L90-L116
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/SpanUtil.java
SpanUtil.toRange
public static Range toRange(Span span) { return new Range(toKey(span.getStart()), span.isStartInclusive(), toKey(span.getEnd()), span.isEndInclusive()); }
java
public static Range toRange(Span span) { return new Range(toKey(span.getStart()), span.isStartInclusive(), toKey(span.getEnd()), span.isEndInclusive()); }
[ "public", "static", "Range", "toRange", "(", "Span", "span", ")", "{", "return", "new", "Range", "(", "toKey", "(", "span", ".", "getStart", "(", ")", ")", ",", "span", ".", "isStartInclusive", "(", ")", ",", "toKey", "(", "span", ".", "getEnd", "(",...
Converts a Fluo Span to Accumulo Range @param span Span @return Range
[ "Converts", "a", "Fluo", "Span", "to", "Accumulo", "Range" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/SpanUtil.java#L39-L42
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/SpanUtil.java
SpanUtil.toKey
public static Key toKey(RowColumn rc) { if ((rc == null) || (rc.getRow().equals(Bytes.EMPTY))) { return null; } Text row = ByteUtil.toText(rc.getRow()); if ((rc.getColumn().equals(Column.EMPTY)) || !rc.getColumn().isFamilySet()) { return new Key(row); } Text cf = ByteUtil.toText(rc.g...
java
public static Key toKey(RowColumn rc) { if ((rc == null) || (rc.getRow().equals(Bytes.EMPTY))) { return null; } Text row = ByteUtil.toText(rc.getRow()); if ((rc.getColumn().equals(Column.EMPTY)) || !rc.getColumn().isFamilySet()) { return new Key(row); } Text cf = ByteUtil.toText(rc.g...
[ "public", "static", "Key", "toKey", "(", "RowColumn", "rc", ")", "{", "if", "(", "(", "rc", "==", "null", ")", "||", "(", "rc", ".", "getRow", "(", ")", ".", "equals", "(", "Bytes", ".", "EMPTY", ")", ")", ")", "{", "return", "null", ";", "}", ...
Converts from a Fluo RowColumn to a Accumulo Key @param rc RowColumn @return Key
[ "Converts", "from", "a", "Fluo", "RowColumn", "to", "a", "Accumulo", "Key" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/SpanUtil.java#L50-L68
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/SpanUtil.java
SpanUtil.toSpan
public static Span toSpan(Range range) { return new Span(toRowColumn(range.getStartKey()), range.isStartKeyInclusive(), toRowColumn(range.getEndKey()), range.isEndKeyInclusive()); }
java
public static Span toSpan(Range range) { return new Span(toRowColumn(range.getStartKey()), range.isStartKeyInclusive(), toRowColumn(range.getEndKey()), range.isEndKeyInclusive()); }
[ "public", "static", "Span", "toSpan", "(", "Range", "range", ")", "{", "return", "new", "Span", "(", "toRowColumn", "(", "range", ".", "getStartKey", "(", ")", ")", ",", "range", ".", "isStartKeyInclusive", "(", ")", ",", "toRowColumn", "(", "range", "."...
Converts an Accumulo Range to a Fluo Span @param range Range @return Span
[ "Converts", "an", "Accumulo", "Range", "to", "a", "Fluo", "Span" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/SpanUtil.java#L76-L79
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/SpanUtil.java
SpanUtil.toRowColumn
public static RowColumn toRowColumn(Key key) { if (key == null) { return RowColumn.EMPTY; } if ((key.getRow() == null) || key.getRow().getLength() == 0) { return RowColumn.EMPTY; } Bytes row = ByteUtil.toBytes(key.getRow()); if ((key.getColumnFamily() == null) || key.getColumnFamily(...
java
public static RowColumn toRowColumn(Key key) { if (key == null) { return RowColumn.EMPTY; } if ((key.getRow() == null) || key.getRow().getLength() == 0) { return RowColumn.EMPTY; } Bytes row = ByteUtil.toBytes(key.getRow()); if ((key.getColumnFamily() == null) || key.getColumnFamily(...
[ "public", "static", "RowColumn", "toRowColumn", "(", "Key", "key", ")", "{", "if", "(", "key", "==", "null", ")", "{", "return", "RowColumn", ".", "EMPTY", ";", "}", "if", "(", "(", "key", ".", "getRow", "(", ")", "==", "null", ")", "||", "key", ...
Converts from an Accumulo Key to a Fluo RowColumn @param key Key @return RowColumn
[ "Converts", "from", "an", "Accumulo", "Key", "to", "a", "Fluo", "RowColumn" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/SpanUtil.java#L87-L108
train
apache/fluo
modules/mapreduce/src/main/java/org/apache/fluo/mapreduce/FluoKeyValueGenerator.java
FluoKeyValueGenerator.set
public FluoKeyValueGenerator set(RowColumnValue rcv) { setRow(rcv.getRow()); setColumn(rcv.getColumn()); setValue(rcv.getValue()); return this; }
java
public FluoKeyValueGenerator set(RowColumnValue rcv) { setRow(rcv.getRow()); setColumn(rcv.getColumn()); setValue(rcv.getValue()); return this; }
[ "public", "FluoKeyValueGenerator", "set", "(", "RowColumnValue", "rcv", ")", "{", "setRow", "(", "rcv", ".", "getRow", "(", ")", ")", ";", "setColumn", "(", "rcv", ".", "getColumn", "(", ")", ")", ";", "setValue", "(", "rcv", ".", "getValue", "(", ")",...
Set the row, column, and value @return this
[ "Set", "the", "row", "column", "and", "value" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/mapreduce/src/main/java/org/apache/fluo/mapreduce/FluoKeyValueGenerator.java#L176-L181
train
apache/fluo
modules/mapreduce/src/main/java/org/apache/fluo/mapreduce/FluoKeyValueGenerator.java
FluoKeyValueGenerator.getKeyValues
public FluoKeyValue[] getKeyValues() { FluoKeyValue kv = keyVals[0]; kv.setKey(new Key(row, fam, qual, vis, ColumnType.WRITE.encode(1))); kv.getValue().set(WriteValue.encode(0, false, false)); kv = keyVals[1]; kv.setKey(new Key(row, fam, qual, vis, ColumnType.DATA.encode(0))); kv.getValue().set...
java
public FluoKeyValue[] getKeyValues() { FluoKeyValue kv = keyVals[0]; kv.setKey(new Key(row, fam, qual, vis, ColumnType.WRITE.encode(1))); kv.getValue().set(WriteValue.encode(0, false, false)); kv = keyVals[1]; kv.setKey(new Key(row, fam, qual, vis, ColumnType.DATA.encode(0))); kv.getValue().set...
[ "public", "FluoKeyValue", "[", "]", "getKeyValues", "(", ")", "{", "FluoKeyValue", "kv", "=", "keyVals", "[", "0", "]", ";", "kv", ".", "setKey", "(", "new", "Key", "(", "row", ",", "fam", ",", "qual", ",", "vis", ",", "ColumnType", ".", "WRITE", "...
Translates the Fluo row, column, and value set into the persistent format that is stored in Accumulo. <p> The objects returned by this method are reused each time its called. So each time this is called it invalidates what was returned by previous calls to this method. @return A an array of Accumulo key values in cor...
[ "Translates", "the", "Fluo", "row", "column", "and", "value", "set", "into", "the", "persistent", "format", "that", "is", "stored", "in", "Accumulo", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/mapreduce/src/main/java/org/apache/fluo/mapreduce/FluoKeyValueGenerator.java#L193-L203
train
apache/fluo
modules/api/src/main/java/org/apache/fluo/api/data/RowColumn.java
RowColumn.following
public RowColumn following() { if (row.equals(Bytes.EMPTY)) { return RowColumn.EMPTY; } else if (col.equals(Column.EMPTY)) { return new RowColumn(followingBytes(row)); } else if (!col.isQualifierSet()) { return new RowColumn(row, new Column(followingBytes(col.getFamily()))); } else if ...
java
public RowColumn following() { if (row.equals(Bytes.EMPTY)) { return RowColumn.EMPTY; } else if (col.equals(Column.EMPTY)) { return new RowColumn(followingBytes(row)); } else if (!col.isQualifierSet()) { return new RowColumn(row, new Column(followingBytes(col.getFamily()))); } else if ...
[ "public", "RowColumn", "following", "(", ")", "{", "if", "(", "row", ".", "equals", "(", "Bytes", ".", "EMPTY", ")", ")", "{", "return", "RowColumn", ".", "EMPTY", ";", "}", "else", "if", "(", "col", ".", "equals", "(", "Column", ".", "EMPTY", ")",...
Returns a RowColumn following the current one @return RowColumn following this one
[ "Returns", "a", "RowColumn", "following", "the", "current", "one" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/api/src/main/java/org/apache/fluo/api/data/RowColumn.java#L143-L156
train
apache/fluo
modules/mapreduce/src/main/java/org/apache/fluo/mapreduce/FluoMutationGenerator.java
FluoMutationGenerator.put
public FluoMutationGenerator put(Column col, CharSequence value) { return put(col, value.toString().getBytes(StandardCharsets.UTF_8)); }
java
public FluoMutationGenerator put(Column col, CharSequence value) { return put(col, value.toString().getBytes(StandardCharsets.UTF_8)); }
[ "public", "FluoMutationGenerator", "put", "(", "Column", "col", ",", "CharSequence", "value", ")", "{", "return", "put", "(", "col", ",", "value", ".", "toString", "(", ")", ".", "getBytes", "(", "StandardCharsets", ".", "UTF_8", ")", ")", ";", "}" ]
Puts value at given column @param value Will be encoded using UTF-8
[ "Puts", "value", "at", "given", "column" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/mapreduce/src/main/java/org/apache/fluo/mapreduce/FluoMutationGenerator.java#L73-L75
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java
CuratorUtil.newAppCurator
public static CuratorFramework newAppCurator(FluoConfiguration config) { return newCurator(config.getAppZookeepers(), config.getZookeeperTimeout(), config.getZookeeperSecret()); }
java
public static CuratorFramework newAppCurator(FluoConfiguration config) { return newCurator(config.getAppZookeepers(), config.getZookeeperTimeout(), config.getZookeeperSecret()); }
[ "public", "static", "CuratorFramework", "newAppCurator", "(", "FluoConfiguration", "config", ")", "{", "return", "newCurator", "(", "config", ".", "getAppZookeepers", "(", ")", ",", "config", ".", "getZookeeperTimeout", "(", ")", ",", "config", ".", "getZookeeperS...
Creates a curator built using Application's zookeeper connection string. Root path will start at Fluo application chroot.
[ "Creates", "a", "curator", "built", "using", "Application", "s", "zookeeper", "connection", "string", ".", "Root", "path", "will", "start", "at", "Fluo", "application", "chroot", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java#L56-L59
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java
CuratorUtil.newFluoCurator
public static CuratorFramework newFluoCurator(FluoConfiguration config) { return newCurator(config.getInstanceZookeepers(), config.getZookeeperTimeout(), config.getZookeeperSecret()); }
java
public static CuratorFramework newFluoCurator(FluoConfiguration config) { return newCurator(config.getInstanceZookeepers(), config.getZookeeperTimeout(), config.getZookeeperSecret()); }
[ "public", "static", "CuratorFramework", "newFluoCurator", "(", "FluoConfiguration", "config", ")", "{", "return", "newCurator", "(", "config", ".", "getInstanceZookeepers", "(", ")", ",", "config", ".", "getZookeeperTimeout", "(", ")", ",", "config", ".", "getZook...
Creates a curator built using Fluo's zookeeper connection string. Root path will start at Fluo chroot.
[ "Creates", "a", "curator", "built", "using", "Fluo", "s", "zookeeper", "connection", "string", ".", "Root", "path", "will", "start", "at", "Fluo", "chroot", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java#L65-L68
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java
CuratorUtil.newCurator
public static CuratorFramework newCurator(String zookeepers, int timeout, String secret) { final ExponentialBackoffRetry retry = new ExponentialBackoffRetry(1000, 10); if (secret.isEmpty()) { return CuratorFrameworkFactory.newClient(zookeepers, timeout, timeout, retry); } else { return CuratorF...
java
public static CuratorFramework newCurator(String zookeepers, int timeout, String secret) { final ExponentialBackoffRetry retry = new ExponentialBackoffRetry(1000, 10); if (secret.isEmpty()) { return CuratorFrameworkFactory.newClient(zookeepers, timeout, timeout, retry); } else { return CuratorF...
[ "public", "static", "CuratorFramework", "newCurator", "(", "String", "zookeepers", ",", "int", "timeout", ",", "String", "secret", ")", "{", "final", "ExponentialBackoffRetry", "retry", "=", "new", "ExponentialBackoffRetry", "(", "1000", ",", "10", ")", ";", "if...
Creates a curator built using the given zookeeper connection string and timeout
[ "Creates", "a", "curator", "built", "using", "the", "given", "zookeeper", "connection", "string", "and", "timeout" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java#L88-L116
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java
CuratorUtil.startAndWait
public static void startAndWait(PersistentNode node, int maxWaitSec) { node.start(); int waitTime = 0; try { while (node.waitForInitialCreate(1, TimeUnit.SECONDS) == false) { waitTime += 1; log.info("Waited " + waitTime + " sec for ephemeral node to be created"); if (waitTime >...
java
public static void startAndWait(PersistentNode node, int maxWaitSec) { node.start(); int waitTime = 0; try { while (node.waitForInitialCreate(1, TimeUnit.SECONDS) == false) { waitTime += 1; log.info("Waited " + waitTime + " sec for ephemeral node to be created"); if (waitTime >...
[ "public", "static", "void", "startAndWait", "(", "PersistentNode", "node", ",", "int", "maxWaitSec", ")", "{", "node", ".", "start", "(", ")", ";", "int", "waitTime", "=", "0", ";", "try", "{", "while", "(", "node", ".", "waitForInitialCreate", "(", "1",...
Starts the ephemeral node and waits for it to be created @param node Node to start @param maxWaitSec Maximum time in seconds to wait
[ "Starts", "the", "ephemeral", "node", "and", "waits", "for", "it", "to", "be", "created" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java#L163-L177
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java
CuratorUtil.startAppIdWatcher
public static NodeCache startAppIdWatcher(Environment env) { try { CuratorFramework curator = env.getSharedResources().getCurator(); byte[] uuidBytes = curator.getData().forPath(ZookeeperPath.CONFIG_FLUO_APPLICATION_ID); if (uuidBytes == null) { Halt.halt("Fluo Application UUID not found"...
java
public static NodeCache startAppIdWatcher(Environment env) { try { CuratorFramework curator = env.getSharedResources().getCurator(); byte[] uuidBytes = curator.getData().forPath(ZookeeperPath.CONFIG_FLUO_APPLICATION_ID); if (uuidBytes == null) { Halt.halt("Fluo Application UUID not found"...
[ "public", "static", "NodeCache", "startAppIdWatcher", "(", "Environment", "env", ")", "{", "try", "{", "CuratorFramework", "curator", "=", "env", ".", "getSharedResources", "(", ")", ".", "getCurator", "(", ")", ";", "byte", "[", "]", "uuidBytes", "=", "cura...
Start watching the fluo app uuid. If it changes or goes away then halt the process.
[ "Start", "watching", "the", "fluo", "app", "uuid", ".", "If", "it", "changes", "or", "goes", "away", "then", "halt", "the", "process", "." ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/util/CuratorUtil.java#L182-L206
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/impl/Environment.java
Environment.readZookeeperConfig
private void readZookeeperConfig() { try (CuratorFramework curator = CuratorUtil.newAppCurator(config)) { curator.start(); accumuloInstance = new String(curator.getData().forPath(ZookeeperPath.CONFIG_ACCUMULO_INSTANCE_NAME), StandardCharsets.UTF_8); accumuloInstanceID = ...
java
private void readZookeeperConfig() { try (CuratorFramework curator = CuratorUtil.newAppCurator(config)) { curator.start(); accumuloInstance = new String(curator.getData().forPath(ZookeeperPath.CONFIG_ACCUMULO_INSTANCE_NAME), StandardCharsets.UTF_8); accumuloInstanceID = ...
[ "private", "void", "readZookeeperConfig", "(", ")", "{", "try", "(", "CuratorFramework", "curator", "=", "CuratorUtil", ".", "newAppCurator", "(", "config", ")", ")", "{", "curator", ".", "start", "(", ")", ";", "accumuloInstance", "=", "new", "String", "(",...
Read configuration from zookeeper
[ "Read", "configuration", "from", "zookeeper" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/Environment.java#L133-L160
train
apache/fluo
modules/core/src/main/java/org/apache/fluo/core/impl/TransactorNode.java
TransactorNode.close
@Override public void close() { status = TrStatus.CLOSED; try { node.close(); } catch (IOException e) { log.error("Failed to close ephemeral node"); throw new IllegalStateException(e); } }
java
@Override public void close() { status = TrStatus.CLOSED; try { node.close(); } catch (IOException e) { log.error("Failed to close ephemeral node"); throw new IllegalStateException(e); } }
[ "@", "Override", "public", "void", "close", "(", ")", "{", "status", "=", "TrStatus", ".", "CLOSED", ";", "try", "{", "node", ".", "close", "(", ")", ";", "}", "catch", "(", "IOException", "e", ")", "{", "log", ".", "error", "(", "\"Failed to close e...
Closes the transactor node by removing its node in Zookeeper
[ "Closes", "the", "transactor", "node", "by", "removing", "its", "node", "in", "Zookeeper" ]
8e06204d4167651e2d3b5219b8c1397644e6ba6e
https://github.com/apache/fluo/blob/8e06204d4167651e2d3b5219b8c1397644e6ba6e/modules/core/src/main/java/org/apache/fluo/core/impl/TransactorNode.java#L89-L98
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/bean/BeanInfoIntrospector.java
BeanInfoIntrospector.expand
private static Map<String, Set<String>> expand(Map<String, Set<String>> viewToPropNames) { Set<String> baseProps = viewToPropNames.get(PropertyView.BASE_VIEW); if (baseProps == null) { baseProps = ImmutableSet.of(); } if (!SquigglyConfig.isFilterImplicitlyIncludeBaseFields...
java
private static Map<String, Set<String>> expand(Map<String, Set<String>> viewToPropNames) { Set<String> baseProps = viewToPropNames.get(PropertyView.BASE_VIEW); if (baseProps == null) { baseProps = ImmutableSet.of(); } if (!SquigglyConfig.isFilterImplicitlyIncludeBaseFields...
[ "private", "static", "Map", "<", "String", ",", "Set", "<", "String", ">", ">", "expand", "(", "Map", "<", "String", ",", "Set", "<", "String", ">", ">", "viewToPropNames", ")", "{", "Set", "<", "String", ">", "baseProps", "=", "viewToPropNames", ".", ...
apply the base fields to other views if configured to do so.
[ "apply", "the", "base", "fields", "to", "other", "views", "if", "configured", "to", "do", "so", "." ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/bean/BeanInfoIntrospector.java#L191-L221
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/parser/SquigglyParser.java
SquigglyParser.parse
public List<SquigglyNode> parse(String filter) { filter = StringUtils.trim(filter); if (StringUtils.isEmpty(filter)) { return Collections.emptyList(); } // get it from the cache if we can List<SquigglyNode> cachedNodes = CACHE.getIfPresent(filter); if (cach...
java
public List<SquigglyNode> parse(String filter) { filter = StringUtils.trim(filter); if (StringUtils.isEmpty(filter)) { return Collections.emptyList(); } // get it from the cache if we can List<SquigglyNode> cachedNodes = CACHE.getIfPresent(filter); if (cach...
[ "public", "List", "<", "SquigglyNode", ">", "parse", "(", "String", "filter", ")", "{", "filter", "=", "StringUtils", ".", "trim", "(", "filter", ")", ";", "if", "(", "StringUtils", ".", "isEmpty", "(", "filter", ")", ")", "{", "return", "Collections", ...
Parse a filter expression. @param filter the filter expression @return compiled nodes
[ "Parse", "a", "filter", "expression", "." ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/parser/SquigglyParser.java#L43-L66
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java
SquigglyUtils.collectify
public static <E> Collection<E> collectify(ObjectMapper mapper, Object source, Class<? extends Collection> targetCollectionType, Class<E> targetElementType) { CollectionType collectionType = mapper.getTypeFactory().constructCollectionType(targetCollectionType, targetElementType); return objectify(mapper...
java
public static <E> Collection<E> collectify(ObjectMapper mapper, Object source, Class<? extends Collection> targetCollectionType, Class<E> targetElementType) { CollectionType collectionType = mapper.getTypeFactory().constructCollectionType(targetCollectionType, targetElementType); return objectify(mapper...
[ "public", "static", "<", "E", ">", "Collection", "<", "E", ">", "collectify", "(", "ObjectMapper", "mapper", ",", "Object", "source", ",", "Class", "<", "?", "extends", "Collection", ">", "targetCollectionType", ",", "Class", "<", "E", ">", "targetElementTyp...
Convert an object to a collection. @param mapper the object mapper @param source the source object @param targetCollectionType the target collection type @param targetElementType the target collection element type @return collection
[ "Convert", "an", "object", "to", "a", "collection", "." ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L45-L48
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java
SquigglyUtils.listify
public static List<Map<String, Object>> listify(ObjectMapper mapper, Object source) { return (List<Map<String, Object>>) collectify(mapper, source, List.class); }
java
public static List<Map<String, Object>> listify(ObjectMapper mapper, Object source) { return (List<Map<String, Object>>) collectify(mapper, source, List.class); }
[ "public", "static", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", "listify", "(", "ObjectMapper", "mapper", ",", "Object", "source", ")", "{", "return", "(", "List", "<", "Map", "<", "String", ",", "Object", ">", ">", ")", "collectify", ...
Convert an object to a list of maps. @param mapper the object mapper @param source the source object @return list
[ "Convert", "an", "object", "to", "a", "list", "of", "maps", "." ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L99-L101
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java
SquigglyUtils.listify
public static <E> List<E> listify(ObjectMapper mapper, Object source, Class<E> targetElementType) { return (List<E>) collectify(mapper, source, List.class, targetElementType); }
java
public static <E> List<E> listify(ObjectMapper mapper, Object source, Class<E> targetElementType) { return (List<E>) collectify(mapper, source, List.class, targetElementType); }
[ "public", "static", "<", "E", ">", "List", "<", "E", ">", "listify", "(", "ObjectMapper", "mapper", ",", "Object", "source", ",", "Class", "<", "E", ">", "targetElementType", ")", "{", "return", "(", "List", "<", "E", ">", ")", "collectify", "(", "ma...
Convert an object to a list. @param mapper the object mapper @param source the source object @param targetElementType the target list element type @return list
[ "Convert", "an", "object", "to", "a", "list", "." ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L111-L113
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java
SquigglyUtils.objectify
public static Object objectify(ObjectMapper mapper, Object source) { return objectify(mapper, source, Object.class); }
java
public static Object objectify(ObjectMapper mapper, Object source) { return objectify(mapper, source, Object.class); }
[ "public", "static", "Object", "objectify", "(", "ObjectMapper", "mapper", ",", "Object", "source", ")", "{", "return", "objectify", "(", "mapper", ",", "source", ",", "Object", ".", "class", ")", ";", "}" ]
Converts an object to an object, with squiggly filters applied. @param mapper the object mapper @param source the source to convert @return target instance @see SquigglyUtils#objectify(ObjectMapper, Object, Class)
[ "Converts", "an", "object", "to", "an", "object", "with", "squiggly", "filters", "applied", "." ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L148-L150
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java
SquigglyUtils.objectify
public static <T> T objectify(ObjectMapper mapper, Object source, JavaType targetType) { try { return mapper.readValue(mapper.writeValueAsBytes(source), targetType); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e);...
java
public static <T> T objectify(ObjectMapper mapper, Object source, JavaType targetType) { try { return mapper.readValue(mapper.writeValueAsBytes(source), targetType); } catch (RuntimeException e) { throw e; } catch (Exception e) { throw new RuntimeException(e);...
[ "public", "static", "<", "T", ">", "T", "objectify", "(", "ObjectMapper", "mapper", ",", "Object", "source", ",", "JavaType", "targetType", ")", "{", "try", "{", "return", "mapper", ".", "readValue", "(", "mapper", ".", "writeValueAsBytes", "(", "source", ...
Converts an object to an instance of the target type. @param mapper the object mapper @param source the source to convert @param targetType the target class type @return target instance @see SquigglyUtils#objectify(ObjectMapper, Object, Class)
[ "Converts", "an", "object", "to", "an", "instance", "of", "the", "target", "type", "." ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L176-L184
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java
SquigglyUtils.setify
public static Set<Map<String, Object>> setify(ObjectMapper mapper, Object source) { return (Set<Map<String, Object>>) collectify(mapper, source, Set.class); }
java
public static Set<Map<String, Object>> setify(ObjectMapper mapper, Object source) { return (Set<Map<String, Object>>) collectify(mapper, source, Set.class); }
[ "public", "static", "Set", "<", "Map", "<", "String", ",", "Object", ">", ">", "setify", "(", "ObjectMapper", "mapper", ",", "Object", "source", ")", "{", "return", "(", "Set", "<", "Map", "<", "String", ",", "Object", ">", ">", ")", "collectify", "(...
Convert an object to a set of maps. @param mapper the object mapper @param source the source object @return set
[ "Convert", "an", "object", "to", "a", "set", "of", "maps", "." ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L193-L195
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java
SquigglyUtils.setify
public static <E> Set<E> setify(ObjectMapper mapper, Object source, Class<E> targetElementType) { return (Set<E>) collectify(mapper, source, Set.class, targetElementType); }
java
public static <E> Set<E> setify(ObjectMapper mapper, Object source, Class<E> targetElementType) { return (Set<E>) collectify(mapper, source, Set.class, targetElementType); }
[ "public", "static", "<", "E", ">", "Set", "<", "E", ">", "setify", "(", "ObjectMapper", "mapper", ",", "Object", "source", ",", "Class", "<", "E", ">", "targetElementType", ")", "{", "return", "(", "Set", "<", "E", ">", ")", "collectify", "(", "mappe...
Convert an object to a set. @param mapper the object mapper @param source the source object @param targetElementType the target set element type @return set
[ "Convert", "an", "object", "to", "a", "set", "." ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L205-L207
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java
SquigglyUtils.stringify
public static String stringify(ObjectMapper mapper, Object object) { try { return mapper.writeValueAsString(object); } catch (JsonProcessingException e) { throw new IllegalArgumentException(e); } }
java
public static String stringify(ObjectMapper mapper, Object object) { try { return mapper.writeValueAsString(object); } catch (JsonProcessingException e) { throw new IllegalArgumentException(e); } }
[ "public", "static", "String", "stringify", "(", "ObjectMapper", "mapper", ",", "Object", "object", ")", "{", "try", "{", "return", "mapper", ".", "writeValueAsString", "(", "object", ")", ";", "}", "catch", "(", "JsonProcessingException", "e", ")", "{", "thr...
Takes an object and converts it to a string. @param mapper the object mapper @param object the object to convert @return json string
[ "Takes", "an", "object", "and", "converts", "it", "to", "a", "string", "." ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L241-L247
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/filter/SquigglyPropertyFilter.java
SquigglyPropertyFilter.getPath
private Path getPath(PropertyWriter writer, JsonStreamContext sc) { LinkedList<PathElement> elements = new LinkedList<>(); if (sc != null) { elements.add(new PathElement(writer.getName(), sc.getCurrentValue())); sc = sc.getParent(); } while (sc != null) { ...
java
private Path getPath(PropertyWriter writer, JsonStreamContext sc) { LinkedList<PathElement> elements = new LinkedList<>(); if (sc != null) { elements.add(new PathElement(writer.getName(), sc.getCurrentValue())); sc = sc.getParent(); } while (sc != null) { ...
[ "private", "Path", "getPath", "(", "PropertyWriter", "writer", ",", "JsonStreamContext", "sc", ")", "{", "LinkedList", "<", "PathElement", ">", "elements", "=", "new", "LinkedList", "<>", "(", ")", ";", "if", "(", "sc", "!=", "null", ")", "{", "elements", ...
create a path structure representing the object graph
[ "create", "a", "path", "structure", "representing", "the", "object", "graph" ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/filter/SquigglyPropertyFilter.java#L110-L126
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/filter/SquigglyPropertyFilter.java
SquigglyPropertyFilter.pathMatches
private boolean pathMatches(Path path, SquigglyContext context) { List<SquigglyNode> nodes = context.getNodes(); Set<String> viewStack = null; SquigglyNode viewNode = null; int pathSize = path.getElements().size(); int lastIdx = pathSize - 1; for (int i = 0; i < pathSiz...
java
private boolean pathMatches(Path path, SquigglyContext context) { List<SquigglyNode> nodes = context.getNodes(); Set<String> viewStack = null; SquigglyNode viewNode = null; int pathSize = path.getElements().size(); int lastIdx = pathSize - 1; for (int i = 0; i < pathSiz...
[ "private", "boolean", "pathMatches", "(", "Path", "path", ",", "SquigglyContext", "context", ")", "{", "List", "<", "SquigglyNode", ">", "nodes", "=", "context", ".", "getNodes", "(", ")", ";", "Set", "<", "String", ">", "viewStack", "=", "null", ";", "S...
perform the actual matching
[ "perform", "the", "actual", "matching" ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/filter/SquigglyPropertyFilter.java#L180-L242
train
bohnman/squiggly-java
src/main/java/com/github/bohnman/squiggly/metric/SquigglyMetrics.java
SquigglyMetrics.asMap
public static SortedMap<String, Object> asMap() { SortedMap<String, Object> metrics = Maps.newTreeMap(); METRICS_SOURCE.applyMetrics(metrics); return metrics; }
java
public static SortedMap<String, Object> asMap() { SortedMap<String, Object> metrics = Maps.newTreeMap(); METRICS_SOURCE.applyMetrics(metrics); return metrics; }
[ "public", "static", "SortedMap", "<", "String", ",", "Object", ">", "asMap", "(", ")", "{", "SortedMap", "<", "String", ",", "Object", ">", "metrics", "=", "Maps", ".", "newTreeMap", "(", ")", ";", "METRICS_SOURCE", ".", "applyMetrics", "(", "metrics", "...
Gets the metrics as a map whose keys are the metric name and whose values are the metric values. @return map
[ "Gets", "the", "metrics", "as", "a", "map", "whose", "keys", "are", "the", "metric", "name", "and", "whose", "values", "are", "the", "metric", "values", "." ]
ba0c0b924ab718225d1ad180273ee63ea6c4f55a
https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/metric/SquigglyMetrics.java#L37-L41
train