id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
108,400 | ist-dresden/composum | sling/core/pckginstall/src/main/java/com/composum/sling/core/pckginstall/PackageTransformer.java | PackageTransformer.getManifest | private static Manifest getManifest(final RegisteredResource rsrc) throws IOException {
try (final InputStream ins = rsrc.getInputStream()) {
if (ins != null) {
try (JarInputStream jis = new JarInputStream(ins)) {
return jis.getManifest();
}
... | java | private static Manifest getManifest(final RegisteredResource rsrc) throws IOException {
try (final InputStream ins = rsrc.getInputStream()) {
if (ins != null) {
try (JarInputStream jis = new JarInputStream(ins)) {
return jis.getManifest();
}
... | [
"private",
"static",
"Manifest",
"getManifest",
"(",
"final",
"RegisteredResource",
"rsrc",
")",
"throws",
"IOException",
"{",
"try",
"(",
"final",
"InputStream",
"ins",
"=",
"rsrc",
".",
"getInputStream",
"(",
")",
")",
"{",
"if",
"(",
"ins",
"!=",
"null",
... | Read the manifest from supplied input stream, which is closed before return. | [
"Read",
"the",
"manifest",
"from",
"supplied",
"input",
"stream",
"which",
"is",
"closed",
"before",
"return",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/pckginstall/src/main/java/com/composum/sling/core/pckginstall/PackageTransformer.java#L194-L204 |
108,401 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/PropertyUtil.java | PropertyUtil.readValue | public static <T> T readValue(Value value, Class<T> type) throws RepositoryException {
try {
if (null == value) return null;
if (type.isAssignableFrom(value.getClass())) return type.cast(value);
if (Long.class.equals(type)) return type.cast(value.getLong());
if (... | java | public static <T> T readValue(Value value, Class<T> type) throws RepositoryException {
try {
if (null == value) return null;
if (type.isAssignableFrom(value.getClass())) return type.cast(value);
if (Long.class.equals(type)) return type.cast(value.getLong());
if (... | [
"public",
"static",
"<",
"T",
">",
"T",
"readValue",
"(",
"Value",
"value",
",",
"Class",
"<",
"T",
">",
"type",
")",
"throws",
"RepositoryException",
"{",
"try",
"{",
"if",
"(",
"null",
"==",
"value",
")",
"return",
"null",
";",
"if",
"(",
"type",
... | Reads the value of a property as the given type. | [
"Reads",
"the",
"value",
"of",
"a",
"property",
"as",
"the",
"given",
"type",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/PropertyUtil.java#L294-L324 |
108,402 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/MimeTypeUtil.java | MimeTypeUtil.getParentMimeType | private static MimeType getParentMimeType(Resource resource) {
MimeType result = null;
if (resource != null && (resource = resource.getParent()) != null) {
ResourceHandle handle = ResourceHandle.use(resource);
result = getMimeType(handle.getProperty(ResourceUtil.PROP_MIME_TYPE, "... | java | private static MimeType getParentMimeType(Resource resource) {
MimeType result = null;
if (resource != null && (resource = resource.getParent()) != null) {
ResourceHandle handle = ResourceHandle.use(resource);
result = getMimeType(handle.getProperty(ResourceUtil.PROP_MIME_TYPE, "... | [
"private",
"static",
"MimeType",
"getParentMimeType",
"(",
"Resource",
"resource",
")",
"{",
"MimeType",
"result",
"=",
"null",
";",
"if",
"(",
"resource",
"!=",
"null",
"&&",
"(",
"resource",
"=",
"resource",
".",
"getParent",
"(",
")",
")",
"!=",
"null",... | a helper if the resource is a content node an should use its parent as a fallback | [
"a",
"helper",
"if",
"the",
"resource",
"is",
"a",
"content",
"node",
"an",
"should",
"use",
"its",
"parent",
"as",
"a",
"fallback"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/MimeTypeUtil.java#L107-L118 |
108,403 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/MimeTypeUtil.java | MimeTypeUtil.getContentMimeType | private static MimeType getContentMimeType(Resource resource) {
MimeType result = null;
if (resource != null && (resource = resource.getChild(ResourceUtil.CONTENT_NODE)) != null) {
ResourceHandle handle = ResourceHandle.use(resource);
result = getMimeType(handle.getProperty(Resou... | java | private static MimeType getContentMimeType(Resource resource) {
MimeType result = null;
if (resource != null && (resource = resource.getChild(ResourceUtil.CONTENT_NODE)) != null) {
ResourceHandle handle = ResourceHandle.use(resource);
result = getMimeType(handle.getProperty(Resou... | [
"private",
"static",
"MimeType",
"getContentMimeType",
"(",
"Resource",
"resource",
")",
"{",
"MimeType",
"result",
"=",
"null",
";",
"if",
"(",
"resource",
"!=",
"null",
"&&",
"(",
"resource",
"=",
"resource",
".",
"getChild",
"(",
"ResourceUtil",
".",
"CON... | a helper if the resource has a content node an should use this content as a fallback | [
"a",
"helper",
"if",
"the",
"resource",
"has",
"a",
"content",
"node",
"an",
"should",
"use",
"this",
"content",
"as",
"a",
"fallback"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/MimeTypeUtil.java#L123-L130 |
108,404 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/MimeTypeUtil.java | MimeTypeUtil.getMimeType | public static MimeType getMimeType(String value) {
if (StringUtils.isNotBlank(value)) {
try {
return getMimeTypes().forName(value);
} catch (MimeTypeException e) {
MediaType mediaType = getMediaType(null, value);
if (mediaType != null) {
... | java | public static MimeType getMimeType(String value) {
if (StringUtils.isNotBlank(value)) {
try {
return getMimeTypes().forName(value);
} catch (MimeTypeException e) {
MediaType mediaType = getMediaType(null, value);
if (mediaType != null) {
... | [
"public",
"static",
"MimeType",
"getMimeType",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"value",
")",
")",
"{",
"try",
"{",
"return",
"getMimeTypes",
"(",
")",
".",
"forName",
"(",
"value",
")",
";",
"}",
"cat... | Retrieves the MimeType object according to a name value
@param value the name hint; can be a mime type value or a filename | [
"Retrieves",
"the",
"MimeType",
"object",
"according",
"to",
"a",
"name",
"value"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/MimeTypeUtil.java#L240-L256 |
108,405 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/AbstractSlingBean.java | AbstractSlingBean.initialize | public void initialize(BeanContext context, Resource resource) {
if (LOG.isDebugEnabled()) {
LOG.debug("initialize (" + context + ", " + resource + ")");
}
this.context = context;
this.resource = ResourceHandle.use(resource);
} | java | public void initialize(BeanContext context, Resource resource) {
if (LOG.isDebugEnabled()) {
LOG.debug("initialize (" + context + ", " + resource + ")");
}
this.context = context;
this.resource = ResourceHandle.use(resource);
} | [
"public",
"void",
"initialize",
"(",
"BeanContext",
"context",
",",
"Resource",
"resource",
")",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"initialize (\"",
"+",
"context",
"+",
"\", \"",
"+",
"resource",... | This basic initialization sets up the context and resource attributes only,
all the other attributes are set 'lazy' during their getter calls.
@param context the scripting context (e.g. a JSP PageContext or a Groovy scripting context)
@param resource the resource to use (normally the resource addressed by the request... | [
"This",
"basic",
"initialization",
"sets",
"up",
"the",
"context",
"and",
"resource",
"attributes",
"only",
"all",
"the",
"other",
"attributes",
"are",
"set",
"lazy",
"during",
"their",
"getter",
"calls",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/AbstractSlingBean.java#L104-L110 |
108,406 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/AbstractSlingBean.java | AbstractSlingBean.getParent | public ResourceHandle getParent(String resourceType) {
ResourceHandle result = getResource();
while (result.isValid() && !result.isResourceType(resourceType)) {
result = result.getParent();
}
if (!result.isValid()) {
result = getParent(resourceType, getPath()); //... | java | public ResourceHandle getParent(String resourceType) {
ResourceHandle result = getResource();
while (result.isValid() && !result.isResourceType(resourceType)) {
result = result.getParent();
}
if (!result.isValid()) {
result = getParent(resourceType, getPath()); //... | [
"public",
"ResourceHandle",
"getParent",
"(",
"String",
"resourceType",
")",
"{",
"ResourceHandle",
"result",
"=",
"getResource",
"(",
")",
";",
"while",
"(",
"result",
".",
"isValid",
"(",
")",
"&&",
"!",
"result",
".",
"isResourceType",
"(",
"resourceType",
... | Determine a typed parent resource. | [
"Determine",
"a",
"typed",
"parent",
"resource",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/AbstractSlingBean.java#L200-L209 |
108,407 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/RequestHandle.java | RequestHandle.getExtension | public String getExtension() {
String extension = getSlingRequest().getRequestPathInfo().getExtension();
return StringUtils.isBlank(extension) ? "" : ("." + extension);
} | java | public String getExtension() {
String extension = getSlingRequest().getRequestPathInfo().getExtension();
return StringUtils.isBlank(extension) ? "" : ("." + extension);
} | [
"public",
"String",
"getExtension",
"(",
")",
"{",
"String",
"extension",
"=",
"getSlingRequest",
"(",
")",
".",
"getRequestPathInfo",
"(",
")",
".",
"getExtension",
"(",
")",
";",
"return",
"StringUtils",
".",
"isBlank",
"(",
"extension",
")",
"?",
"\"\"",
... | Returns the request extension with a leading '.' if present. | [
"Returns",
"the",
"request",
"extension",
"with",
"a",
"leading",
".",
"if",
"present",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/RequestHandle.java#L78-L81 |
108,408 | ist-dresden/composum | sling/core/usermgnt/src/main/java/com/composum/sling/core/usermanagement/view/User.java | User.isCurrentUserAdmin | public boolean isCurrentUserAdmin() throws RepositoryException {
boolean isAdmin = false;
final JackrabbitSession session = (JackrabbitSession) getSession();
final UserManager userManager = session.getUserManager();
Authorizable a = userManager.getAuthorizable(getRequest().getUserPrincipal(... | java | public boolean isCurrentUserAdmin() throws RepositoryException {
boolean isAdmin = false;
final JackrabbitSession session = (JackrabbitSession) getSession();
final UserManager userManager = session.getUserManager();
Authorizable a = userManager.getAuthorizable(getRequest().getUserPrincipal(... | [
"public",
"boolean",
"isCurrentUserAdmin",
"(",
")",
"throws",
"RepositoryException",
"{",
"boolean",
"isAdmin",
"=",
"false",
";",
"final",
"JackrabbitSession",
"session",
"=",
"(",
"JackrabbitSession",
")",
"getSession",
"(",
")",
";",
"final",
"UserManager",
"u... | Returns true if the current request user is the admin user. | [
"Returns",
"true",
"if",
"the",
"current",
"request",
"user",
"is",
"the",
"admin",
"user",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/usermgnt/src/main/java/com/composum/sling/core/usermanagement/view/User.java#L69-L78 |
108,409 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/clientlibs/processor/ProcessorContext.java | ProcessorContext.submit | public <T> Future<T> submit(Callable<T> callable) {
return executorService.submit(callable);
} | java | public <T> Future<T> submit(Callable<T> callable) {
return executorService.submit(callable);
} | [
"public",
"<",
"T",
">",
"Future",
"<",
"T",
">",
"submit",
"(",
"Callable",
"<",
"T",
">",
"callable",
")",
"{",
"return",
"executorService",
".",
"submit",
"(",
"callable",
")",
";",
"}"
] | Schedules something for execution in the future. | [
"Schedules",
"something",
"for",
"execution",
"in",
"the",
"future",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/clientlibs/processor/ProcessorContext.java#L65-L67 |
108,410 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/RequestUtil.java | RequestUtil.getExtension | public static <T extends Enum> T getExtension(SlingHttpServletRequest request, T defaultValue) {
String extension = request.getRequestPathInfo().getExtension();
if (extension != null) {
Class type = defaultValue.getClass();
try {
T value = (T) T.valueOf(type, exte... | java | public static <T extends Enum> T getExtension(SlingHttpServletRequest request, T defaultValue) {
String extension = request.getRequestPathInfo().getExtension();
if (extension != null) {
Class type = defaultValue.getClass();
try {
T value = (T) T.valueOf(type, exte... | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
">",
"T",
"getExtension",
"(",
"SlingHttpServletRequest",
"request",
",",
"T",
"defaultValue",
")",
"{",
"String",
"extension",
"=",
"request",
".",
"getRequestPathInfo",
"(",
")",
".",
"getExtension",
"(",
")",... | Returns the enum value of the requests extension if appropriate otherwise the default value.
@param request the request object with the extension info
@param defaultValue the default enum value
@param <T> the enum type derived from the default value | [
"Returns",
"the",
"enum",
"value",
"of",
"the",
"requests",
"extension",
"if",
"appropriate",
"otherwise",
"the",
"default",
"value",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/RequestUtil.java#L31-L43 |
108,411 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/RequestUtil.java | RequestUtil.getSelector | public static <T extends Enum> T getSelector(SlingHttpServletRequest request, T defaultValue) {
String[] selectors = request.getRequestPathInfo().getSelectors();
Class type = defaultValue.getClass();
for (String selector : selectors) {
try {
T value = (T) T.valueOf(ty... | java | public static <T extends Enum> T getSelector(SlingHttpServletRequest request, T defaultValue) {
String[] selectors = request.getRequestPathInfo().getSelectors();
Class type = defaultValue.getClass();
for (String selector : selectors) {
try {
T value = (T) T.valueOf(ty... | [
"public",
"static",
"<",
"T",
"extends",
"Enum",
">",
"T",
"getSelector",
"(",
"SlingHttpServletRequest",
"request",
",",
"T",
"defaultValue",
")",
"{",
"String",
"[",
"]",
"selectors",
"=",
"request",
".",
"getRequestPathInfo",
"(",
")",
".",
"getSelectors",
... | Returns an enum value from selectors if an appropriate selector
can be found otherwise the default value given.
@param request the request object with the selector info
@param defaultValue the default enum value
@param <T> the enum type derived from the default value | [
"Returns",
"an",
"enum",
"value",
"from",
"selectors",
"if",
"an",
"appropriate",
"selector",
"can",
"be",
"found",
"otherwise",
"the",
"default",
"value",
"given",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/RequestUtil.java#L53-L65 |
108,412 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/RequestUtil.java | RequestUtil.checkSelector | public static boolean checkSelector(SlingHttpServletRequest request, String key) {
String[] selectors = request.getRequestPathInfo().getSelectors();
for (String selector : selectors) {
if (selector.equals(key)) {
return true;
}
}
return false;
... | java | public static boolean checkSelector(SlingHttpServletRequest request, String key) {
String[] selectors = request.getRequestPathInfo().getSelectors();
for (String selector : selectors) {
if (selector.equals(key)) {
return true;
}
}
return false;
... | [
"public",
"static",
"boolean",
"checkSelector",
"(",
"SlingHttpServletRequest",
"request",
",",
"String",
"key",
")",
"{",
"String",
"[",
"]",
"selectors",
"=",
"request",
".",
"getRequestPathInfo",
"(",
")",
".",
"getSelectors",
"(",
")",
";",
"for",
"(",
"... | Retrieves a key in the selectors and returns 'true' is the key is present.
@param request the request object with the selector info
@param key the selector key which is checked | [
"Retrieves",
"a",
"key",
"in",
"the",
"selectors",
"and",
"returns",
"true",
"is",
"the",
"key",
"is",
"present",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/RequestUtil.java#L73-L81 |
108,413 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/cpnl/CpnlBodyTagSupport.java | CpnlBodyTagSupport.getExpressionUtil | protected com.composum.sling.core.util.ExpressionUtil getExpressionUtil() {
if (expressionUtil == null) {
expressionUtil = new ExpressionUtil(pageContext);
}
return expressionUtil;
} | java | protected com.composum.sling.core.util.ExpressionUtil getExpressionUtil() {
if (expressionUtil == null) {
expressionUtil = new ExpressionUtil(pageContext);
}
return expressionUtil;
} | [
"protected",
"com",
".",
"composum",
".",
"sling",
".",
"core",
".",
"util",
".",
"ExpressionUtil",
"getExpressionUtil",
"(",
")",
"{",
"if",
"(",
"expressionUtil",
"==",
"null",
")",
"{",
"expressionUtil",
"=",
"new",
"ExpressionUtil",
"(",
"pageContext",
"... | Returns or creates the expressionUtil . Not null. | [
"Returns",
"or",
"creates",
"the",
"expressionUtil",
".",
"Not",
"null",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/cpnl/CpnlBodyTagSupport.java#L90-L95 |
108,414 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/InheritedValues.java | InheritedValues.findOriginAndValue | public HierarchyScanResult findOriginAndValue(String name, Class<?> type) {
Object value;
findEntryPoint();
String path = getRelativePath(name);
for (Resource parent = entryPoint; parent != null; parent = parent.getParent()) {
ValueMap parentProps = parent.adaptTo(ValueMap.cl... | java | public HierarchyScanResult findOriginAndValue(String name, Class<?> type) {
Object value;
findEntryPoint();
String path = getRelativePath(name);
for (Resource parent = entryPoint; parent != null; parent = parent.getParent()) {
ValueMap parentProps = parent.adaptTo(ValueMap.cl... | [
"public",
"HierarchyScanResult",
"findOriginAndValue",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"Object",
"value",
";",
"findEntryPoint",
"(",
")",
";",
"String",
"path",
"=",
"getRelativePath",
"(",
"name",
")",
";",
"for",
"(... | Searches the value along the repositories hierarchy by the entry point and path determined before.
@param name the property name or path
@param type the expected type of the value
@return the value found or <code>null</code> if no such value found
in one of the appropriate parent nodes | [
"Searches",
"the",
"value",
"along",
"the",
"repositories",
"hierarchy",
"by",
"the",
"entry",
"point",
"and",
"path",
"determined",
"before",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/InheritedValues.java#L155-L172 |
108,415 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/clientlibs/handle/ClientlibLink.java | ClientlibLink.withHash | public ClientlibLink withHash(String newHash) {
return new ClientlibLink(type, kind, path, properties, newHash);
} | java | public ClientlibLink withHash(String newHash) {
return new ClientlibLink(type, kind, path, properties, newHash);
} | [
"public",
"ClientlibLink",
"withHash",
"(",
"String",
"newHash",
")",
"{",
"return",
"new",
"ClientlibLink",
"(",
"type",
",",
"kind",
",",
"path",
",",
"properties",
",",
"newHash",
")",
";",
"}"
] | Creates a new link with parameters as this except hash.
@param newHash new nullable hash for the resource to be encoded in the URL for clientlibs / - categories. | [
"Creates",
"a",
"new",
"link",
"with",
"parameters",
"as",
"this",
"except",
"hash",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/clientlibs/handle/ClientlibLink.java#L103-L105 |
108,416 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/clientlibs/processor/UpdateTimeVisitor.java | UpdateTimeVisitor.getLastUpdateTime | public Calendar getLastUpdateTime() {
if (null != lastUpdateTime && lastUpdateTime.after(Calendar.getInstance())) {
LOG.warn("Last update time newer than now {} for {}", lastUpdateTime, owner);
return null; // Something's broken - we don't know
}
return lastUpdateTime;
... | java | public Calendar getLastUpdateTime() {
if (null != lastUpdateTime && lastUpdateTime.after(Calendar.getInstance())) {
LOG.warn("Last update time newer than now {} for {}", lastUpdateTime, owner);
return null; // Something's broken - we don't know
}
return lastUpdateTime;
... | [
"public",
"Calendar",
"getLastUpdateTime",
"(",
")",
"{",
"if",
"(",
"null",
"!=",
"lastUpdateTime",
"&&",
"lastUpdateTime",
".",
"after",
"(",
"Calendar",
".",
"getInstance",
"(",
")",
")",
")",
"{",
"LOG",
".",
"warn",
"(",
"\"Last update time newer than now... | Returns the last update time estimated from the file update times and clientlib folder create times.
This is only a lower bound for the update time of the client library including its embedded files. | [
"Returns",
"the",
"last",
"update",
"time",
"estimated",
"from",
"the",
"file",
"update",
"times",
"and",
"clientlib",
"folder",
"create",
"times",
".",
"This",
"is",
"only",
"a",
"lower",
"bound",
"for",
"the",
"update",
"time",
"of",
"the",
"client",
"li... | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/clientlibs/processor/UpdateTimeVisitor.java#L43-L49 |
108,417 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/clientlibs/servlet/ClientlibServlet.java | ClientlibServlet.appendHashSuffix | public static String appendHashSuffix(String url, String hash) {
if (null == hash) return url;
Matcher matcher = FILENAME_PATTERN.matcher(url);
String fname = "";
if (matcher.find()) fname = matcher.group(0);
return url + "/" + hash + "/" + fname;
} | java | public static String appendHashSuffix(String url, String hash) {
if (null == hash) return url;
Matcher matcher = FILENAME_PATTERN.matcher(url);
String fname = "";
if (matcher.find()) fname = matcher.group(0);
return url + "/" + hash + "/" + fname;
} | [
"public",
"static",
"String",
"appendHashSuffix",
"(",
"String",
"url",
",",
"String",
"hash",
")",
"{",
"if",
"(",
"null",
"==",
"hash",
")",
"return",
"url",
";",
"Matcher",
"matcher",
"=",
"FILENAME_PATTERN",
".",
"matcher",
"(",
"url",
")",
";",
"Str... | Appends a suffix containing the hash code, if given. The file name is repeated to satisfy browsers
with the correct type and file name, though it is not used by the servlet.
@param url an url to which we append the suffix
@param hash optional, the hash code
@return the url with suffix /{hash}/{filename} appended, whe... | [
"Appends",
"a",
"suffix",
"containing",
"the",
"hash",
"code",
"if",
"given",
".",
"The",
"file",
"name",
"is",
"repeated",
"to",
"satisfy",
"browsers",
"with",
"the",
"correct",
"type",
"and",
"file",
"name",
"though",
"it",
"is",
"not",
"used",
"by",
"... | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/clientlibs/servlet/ClientlibServlet.java#L86-L92 |
108,418 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/clientlibs/processor/RendererContext.java | RendererContext.isClientlibRendered | public boolean isClientlibRendered(ClientlibRef reference) {
for (ClientlibLink link : renderedClientlibs) {
if (reference.isSatisfiedby(link)) {
LOG.debug("already rendered: {} by {}", reference, link.path);
return true;
}
}
return false;
... | java | public boolean isClientlibRendered(ClientlibRef reference) {
for (ClientlibLink link : renderedClientlibs) {
if (reference.isSatisfiedby(link)) {
LOG.debug("already rendered: {} by {}", reference, link.path);
return true;
}
}
return false;
... | [
"public",
"boolean",
"isClientlibRendered",
"(",
"ClientlibRef",
"reference",
")",
"{",
"for",
"(",
"ClientlibLink",
"link",
":",
"renderedClientlibs",
")",
"{",
"if",
"(",
"reference",
".",
"isSatisfiedby",
"(",
"link",
")",
")",
"{",
"LOG",
".",
"debug",
"... | Checks whether a referenced resource or client library is satisfied by an already rendered resource. | [
"Checks",
"whether",
"a",
"referenced",
"resource",
"or",
"client",
"library",
"is",
"satisfied",
"by",
"an",
"already",
"rendered",
"resource",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/clientlibs/processor/RendererContext.java#L49-L57 |
108,419 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java | ComponentTag.getComponentType | protected Class<? extends SlingBean> getComponentType() throws ClassNotFoundException {
if (componentType == null) {
String type = getType();
if (StringUtils.isNotBlank(type)) {
componentType = (Class<? extends SlingBean>) context.getType(type);
}
... | java | protected Class<? extends SlingBean> getComponentType() throws ClassNotFoundException {
if (componentType == null) {
String type = getType();
if (StringUtils.isNotBlank(type)) {
componentType = (Class<? extends SlingBean>) context.getType(type);
}
... | [
"protected",
"Class",
"<",
"?",
"extends",
"SlingBean",
">",
"getComponentType",
"(",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"componentType",
"==",
"null",
")",
"{",
"String",
"type",
"=",
"getType",
"(",
")",
";",
"if",
"(",
"StringUtils",... | get the content type class object | [
"get",
"the",
"content",
"type",
"class",
"object"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java#L152-L160 |
108,420 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java | ComponentTag.available | protected Object available() throws ClassNotFoundException {
Object result = null;
if (getVar() != null) {
Object value = pageContext.getAttribute(getVar(), getVarScope());
if (value instanceof SlingBean) {
Class<?> type = getComponentType();
... | java | protected Object available() throws ClassNotFoundException {
Object result = null;
if (getVar() != null) {
Object value = pageContext.getAttribute(getVar(), getVarScope());
if (value instanceof SlingBean) {
Class<?> type = getComponentType();
... | [
"protected",
"Object",
"available",
"(",
")",
"throws",
"ClassNotFoundException",
"{",
"Object",
"result",
"=",
"null",
";",
"if",
"(",
"getVar",
"(",
")",
"!=",
"null",
")",
"{",
"Object",
"value",
"=",
"pageContext",
".",
"getAttribute",
"(",
"getVar",
"... | Check for an existing instance of the same var and assignable type | [
"Check",
"for",
"an",
"existing",
"instance",
"of",
"the",
"same",
"var",
"and",
"assignable",
"type"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java#L165-L177 |
108,421 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java | ComponentTag.createComponent | protected SlingBean createComponent() throws ClassNotFoundException, IllegalAccessException,
InstantiationException {
SlingBean component = null;
Class<? extends SlingBean> type = getComponentType();
if (type != null) {
BeanFactory factoryRule = type.getAnnotation(Be... | java | protected SlingBean createComponent() throws ClassNotFoundException, IllegalAccessException,
InstantiationException {
SlingBean component = null;
Class<? extends SlingBean> type = getComponentType();
if (type != null) {
BeanFactory factoryRule = type.getAnnotation(Be... | [
"protected",
"SlingBean",
"createComponent",
"(",
")",
"throws",
"ClassNotFoundException",
",",
"IllegalAccessException",
",",
"InstantiationException",
"{",
"SlingBean",
"component",
"=",
"null",
";",
"Class",
"<",
"?",
"extends",
"SlingBean",
">",
"type",
"=",
"ge... | Create the requested component instance | [
"Create",
"the",
"requested",
"component",
"instance"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java#L182-L200 |
108,422 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java | ComponentTag.getReplacedAttributes | protected Map<String, Object> getReplacedAttributes(int scope) {
if (replacedAttributes == null) {
replacedAttributes = new ArrayList<>();
}
while (replacedAttributes.size() <= scope) {
replacedAttributes.add(new HashMap<String, Object>());
}
return... | java | protected Map<String, Object> getReplacedAttributes(int scope) {
if (replacedAttributes == null) {
replacedAttributes = new ArrayList<>();
}
while (replacedAttributes.size() <= scope) {
replacedAttributes.add(new HashMap<String, Object>());
}
return... | [
"protected",
"Map",
"<",
"String",
",",
"Object",
">",
"getReplacedAttributes",
"(",
"int",
"scope",
")",
"{",
"if",
"(",
"replacedAttributes",
"==",
"null",
")",
"{",
"replacedAttributes",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"}",
"while",
"(",
... | retrieves the registry for one scope | [
"retrieves",
"the",
"registry",
"for",
"one",
"scope"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java#L268-L276 |
108,423 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java | ComponentTag.setAttribute | protected void setAttribute(String key, Object value, int scope) {
Map<String, Object> replacedInScope = getReplacedAttributes(scope);
if (!replacedInScope.containsKey(key)) {
Object current = pageContext.getAttribute(key, scope);
replacedInScope.put(key, current);
}... | java | protected void setAttribute(String key, Object value, int scope) {
Map<String, Object> replacedInScope = getReplacedAttributes(scope);
if (!replacedInScope.containsKey(key)) {
Object current = pageContext.getAttribute(key, scope);
replacedInScope.put(key, current);
}... | [
"protected",
"void",
"setAttribute",
"(",
"String",
"key",
",",
"Object",
"value",
",",
"int",
"scope",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"replacedInScope",
"=",
"getReplacedAttributes",
"(",
"scope",
")",
";",
"if",
"(",
"!",
"replacedIn... | each attribute set by a tag should use this method for attribute declaration;
an existing value with the same key is registered and restored if the tag rendering ends | [
"each",
"attribute",
"set",
"by",
"a",
"tag",
"should",
"use",
"this",
"method",
"for",
"attribute",
"declaration",
";",
"an",
"existing",
"value",
"with",
"the",
"same",
"key",
"is",
"registered",
"and",
"restored",
"if",
"the",
"tag",
"rendering",
"ends"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java#L282-L289 |
108,424 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java | ComponentTag.restoreAttributes | protected void restoreAttributes() {
if (replacedAttributes != null) {
for (int scope = 0; scope < replacedAttributes.size(); scope++) {
Map<String, Object> replaced = replacedAttributes.get(scope);
for (Map.Entry<String, Object> entry : replaced.entrySet()) {
... | java | protected void restoreAttributes() {
if (replacedAttributes != null) {
for (int scope = 0; scope < replacedAttributes.size(); scope++) {
Map<String, Object> replaced = replacedAttributes.get(scope);
for (Map.Entry<String, Object> entry : replaced.entrySet()) {
... | [
"protected",
"void",
"restoreAttributes",
"(",
")",
"{",
"if",
"(",
"replacedAttributes",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"scope",
"=",
"0",
";",
"scope",
"<",
"replacedAttributes",
".",
"size",
"(",
")",
";",
"scope",
"++",
")",
"{",
"Map",... | restores all replaced values and removes all attributes declared in this tag | [
"restores",
"all",
"replaced",
"values",
"and",
"removes",
"all",
"attributes",
"declared",
"in",
"this",
"tag"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/cpnl/ComponentTag.java#L294-L309 |
108,425 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/servlet/ServletOperationSet.java | ServletOperationSet.getOperation | public ServletOperation getOperation(SlingHttpServletRequest request, Method method) {
ServletOperation operation = null;
E extension = RequestUtil.getExtension(request, defaultExtension);
Map<E, O> extensionDefaults = operationDefaults.get(method);
if (extensionDefaults != null) {
... | java | public ServletOperation getOperation(SlingHttpServletRequest request, Method method) {
ServletOperation operation = null;
E extension = RequestUtil.getExtension(request, defaultExtension);
Map<E, O> extensionDefaults = operationDefaults.get(method);
if (extensionDefaults != null) {
... | [
"public",
"ServletOperation",
"getOperation",
"(",
"SlingHttpServletRequest",
"request",
",",
"Method",
"method",
")",
"{",
"ServletOperation",
"operation",
"=",
"null",
";",
"E",
"extension",
"=",
"RequestUtil",
".",
"getExtension",
"(",
"request",
",",
"defaultExt... | Retrieves the servlet operation requested for the used HTTP method.
Looks in the selectors for a operation and gives their implementation in the extensions context.
@param request the servlet request
@param method the requested HTTP method
@return the operation or 'null', if the requested combination of selector
and ... | [
"Retrieves",
"the",
"servlet",
"operation",
"requested",
"for",
"the",
"used",
"HTTP",
"method",
".",
"Looks",
"in",
"the",
"selectors",
"for",
"a",
"operation",
"and",
"gives",
"their",
"implementation",
"in",
"the",
"extensions",
"context",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/servlet/ServletOperationSet.java#L51-L68 |
108,426 | ist-dresden/composum | sling/core/console/src/main/java/com/composum/sling/nodes/servlet/NodeServlet.java | NodeServlet.bindFilterConfiguration | protected synchronized void bindFilterConfiguration(final FilterConfiguration config) {
if (filterConfigurations == null) {
filterConfigurations = new ArrayList<>();
}
filterConfigurations.add(config);
String key = config.getName();
ResourceFilter filter = config.getF... | java | protected synchronized void bindFilterConfiguration(final FilterConfiguration config) {
if (filterConfigurations == null) {
filterConfigurations = new ArrayList<>();
}
filterConfigurations.add(config);
String key = config.getName();
ResourceFilter filter = config.getF... | [
"protected",
"synchronized",
"void",
"bindFilterConfiguration",
"(",
"final",
"FilterConfiguration",
"config",
")",
"{",
"if",
"(",
"filterConfigurations",
"==",
"null",
")",
"{",
"filterConfigurations",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"}",
"filterCo... | for each configured filter in the OSGi configuration
a tree filter is added to the filter set
@param config the OSGi filter configuration object | [
"for",
"each",
"configured",
"filter",
"in",
"the",
"OSGi",
"configuration",
"a",
"tree",
"filter",
"is",
"added",
"to",
"the",
"filter",
"set"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/console/src/main/java/com/composum/sling/nodes/servlet/NodeServlet.java#L130-L140 |
108,427 | ist-dresden/composum | sling/core/console/src/main/java/com/composum/sling/nodes/servlet/NodeServlet.java | NodeServlet.unbindFilterConfiguration | protected synchronized void unbindFilterConfiguration(final FilterConfiguration config) {
nodeFilters.remove(config.getName());
filterConfigurations.remove(config);
} | java | protected synchronized void unbindFilterConfiguration(final FilterConfiguration config) {
nodeFilters.remove(config.getName());
filterConfigurations.remove(config);
} | [
"protected",
"synchronized",
"void",
"unbindFilterConfiguration",
"(",
"final",
"FilterConfiguration",
"config",
")",
"{",
"nodeFilters",
".",
"remove",
"(",
"config",
".",
"getName",
"(",
")",
")",
";",
"filterConfigurations",
".",
"remove",
"(",
"config",
")",
... | removing of a configuration which is not longer available;
removes the corresponding tree filter also
@param config the OSGi filter configuration object to remove | [
"removing",
"of",
"a",
"configuration",
"which",
"is",
"not",
"longer",
"available",
";",
"removes",
"the",
"corresponding",
"tree",
"filter",
"also"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/console/src/main/java/com/composum/sling/nodes/servlet/NodeServlet.java#L148-L151 |
108,428 | ist-dresden/composum | sling/core/console/src/main/java/com/composum/sling/nodes/servlet/NodeServlet.java | NodeServlet.getNodeFilter | protected ResourceFilter getNodeFilter(SlingHttpServletRequest request) {
ResourceFilter filter = null;
String filterParam = RequestUtil.getParameter(request, PARAM_FILTER, (String) null);
if (StringUtils.isNotBlank(filterParam)) {
filter = nodeFilters.get(filterParam);
}
... | java | protected ResourceFilter getNodeFilter(SlingHttpServletRequest request) {
ResourceFilter filter = null;
String filterParam = RequestUtil.getParameter(request, PARAM_FILTER, (String) null);
if (StringUtils.isNotBlank(filterParam)) {
filter = nodeFilters.get(filterParam);
}
... | [
"protected",
"ResourceFilter",
"getNodeFilter",
"(",
"SlingHttpServletRequest",
"request",
")",
"{",
"ResourceFilter",
"filter",
"=",
"null",
";",
"String",
"filterParam",
"=",
"RequestUtil",
".",
"getParameter",
"(",
"request",
",",
"PARAM_FILTER",
",",
"(",
"Strin... | Determines the filter to use for node retrieval; scans the request for filter parameter or selector. | [
"Determines",
"the",
"filter",
"to",
"use",
"for",
"node",
"retrieval",
";",
"scans",
"the",
"request",
"for",
"filter",
"parameter",
"or",
"selector",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/console/src/main/java/com/composum/sling/nodes/servlet/NodeServlet.java#L172-L191 |
108,429 | ist-dresden/composum | sling/core/console/src/main/java/com/composum/sling/nodes/servlet/NodeServlet.java | NodeServlet.prepareTreeItems | @Override
protected List<Resource> prepareTreeItems(ResourceHandle resource, List<Resource> items) {
if (!nodesConfig.getOrderableNodesFilter().accept(resource)) {
Collections.sort(items, new Comparator<Resource>() {
@Override
public int compare(Resource r1, Resou... | java | @Override
protected List<Resource> prepareTreeItems(ResourceHandle resource, List<Resource> items) {
if (!nodesConfig.getOrderableNodesFilter().accept(resource)) {
Collections.sort(items, new Comparator<Resource>() {
@Override
public int compare(Resource r1, Resou... | [
"@",
"Override",
"protected",
"List",
"<",
"Resource",
">",
"prepareTreeItems",
"(",
"ResourceHandle",
"resource",
",",
"List",
"<",
"Resource",
">",
"items",
")",
"{",
"if",
"(",
"!",
"nodesConfig",
".",
"getOrderableNodesFilter",
"(",
")",
".",
"accept",
"... | sort children of orderable nodes | [
"sort",
"children",
"of",
"orderable",
"nodes"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/console/src/main/java/com/composum/sling/nodes/servlet/NodeServlet.java#L597-L608 |
108,430 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/config/FilterConfigurationImpl.java | FilterConfigurationImpl.activate | @Activate
protected void activate(ComponentContext context) {
Dictionary properties = context.getProperties();
name = (String) properties.get("name");
filter = ResourceFilterMapping.fromString((String) properties.get("filter"));
} | java | @Activate
protected void activate(ComponentContext context) {
Dictionary properties = context.getProperties();
name = (String) properties.get("name");
filter = ResourceFilterMapping.fromString((String) properties.get("filter"));
} | [
"@",
"Activate",
"protected",
"void",
"activate",
"(",
"ComponentContext",
"context",
")",
"{",
"Dictionary",
"properties",
"=",
"context",
".",
"getProperties",
"(",
")",
";",
"name",
"=",
"(",
"String",
")",
"properties",
".",
"get",
"(",
"\"name\"",
")",
... | creates the filter instance for the configured rule | [
"creates",
"the",
"filter",
"instance",
"for",
"the",
"configured",
"rule"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/config/FilterConfigurationImpl.java#L59-L64 |
108,431 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/servlet/AbstractServiceServlet.java | AbstractServiceServlet.getResource | public static ResourceHandle getResource(SlingHttpServletRequest request) {
ResourceResolver resolver = request.getResourceResolver();
String path = getPath(request);
ResourceHandle resource = ResourceHandle.use(resolver.resolve(path));
return resource;
} | java | public static ResourceHandle getResource(SlingHttpServletRequest request) {
ResourceResolver resolver = request.getResourceResolver();
String path = getPath(request);
ResourceHandle resource = ResourceHandle.use(resolver.resolve(path));
return resource;
} | [
"public",
"static",
"ResourceHandle",
"getResource",
"(",
"SlingHttpServletRequest",
"request",
")",
"{",
"ResourceResolver",
"resolver",
"=",
"request",
".",
"getResourceResolver",
"(",
")",
";",
"String",
"path",
"=",
"getPath",
"(",
"request",
")",
";",
"Resour... | Retrieves the resource using the suffix from the request.
@param request the sling request with the resource path in the suffix
@return the resource (NOT <code>null</code>; returns a handle with an invalid resource if not resolvable) | [
"Retrieves",
"the",
"resource",
"using",
"the",
"suffix",
"from",
"the",
"request",
"."
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/servlet/AbstractServiceServlet.java#L141-L146 |
108,432 | ist-dresden/composum | sling/core/commons/src/main/java/com/composum/sling/core/util/ConsoleUtil.java | ConsoleUtil.getConsoleResource | public static Resource getConsoleResource(BeanContext context) {
SlingHttpServletRequest request = context.getRequest();
ResourceResolver resolver = request.getResourceResolver();
String path = null;
// use the resource set by a probably executed 'defineObjects' tag (supports including c... | java | public static Resource getConsoleResource(BeanContext context) {
SlingHttpServletRequest request = context.getRequest();
ResourceResolver resolver = request.getResourceResolver();
String path = null;
// use the resource set by a probably executed 'defineObjects' tag (supports including c... | [
"public",
"static",
"Resource",
"getConsoleResource",
"(",
"BeanContext",
"context",
")",
"{",
"SlingHttpServletRequest",
"request",
"=",
"context",
".",
"getRequest",
"(",
")",
";",
"ResourceResolver",
"resolver",
"=",
"request",
".",
"getResourceResolver",
"(",
")... | determines the addressed resource by the suffix if the requests resource is the servlet itself | [
"determines",
"the",
"addressed",
"resource",
"by",
"the",
"suffix",
"if",
"the",
"requests",
"resource",
"is",
"the",
"servlet",
"itself"
] | ebc79f559f6022c935240c19102539bdfb1bd1e2 | https://github.com/ist-dresden/composum/blob/ebc79f559f6022c935240c19102539bdfb1bd1e2/sling/core/commons/src/main/java/com/composum/sling/core/util/ConsoleUtil.java#L16-L42 |
108,433 | bazaarvoice/emodb | sor-api/src/main/java/com/bazaarvoice/emodb/sor/delta/impl/LiteralImpl.java | LiteralImpl.areClassesEqual | private boolean areClassesEqual(Class<?> c1, Class<?> c2) {
if (isMap(c1)) {
return isMap(c2);
} else if (isList(c1)) {
return isList(c2);
} else {
return c1.equals(c2);
}
} | java | private boolean areClassesEqual(Class<?> c1, Class<?> c2) {
if (isMap(c1)) {
return isMap(c2);
} else if (isList(c1)) {
return isList(c2);
} else {
return c1.equals(c2);
}
} | [
"private",
"boolean",
"areClassesEqual",
"(",
"Class",
"<",
"?",
">",
"c1",
",",
"Class",
"<",
"?",
">",
"c2",
")",
"{",
"if",
"(",
"isMap",
"(",
"c1",
")",
")",
"{",
"return",
"isMap",
"(",
"c2",
")",
";",
"}",
"else",
"if",
"(",
"isList",
"("... | When comparing literals allow subclasses of Maps and Lists to be directly compared even if they have
different implementations. | [
"When",
"comparing",
"literals",
"allow",
"subclasses",
"of",
"Maps",
"and",
"Lists",
"to",
"be",
"directly",
"compared",
"even",
"if",
"they",
"have",
"different",
"implementations",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-api/src/main/java/com/bazaarvoice/emodb/sor/delta/impl/LiteralImpl.java#L139-L147 |
108,434 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/auth/EmoPermission.java | EmoPermission.toPart | @Override
protected MatchingPart toPart(List<MatchingPart> leadingParts, String part) {
switch (leadingParts.size()) {
case 0:
// The first part must either be a constant or a pure wildcard; expressions such as
// <code>if(or("sor","blob"))</code> are not permitte... | java | @Override
protected MatchingPart toPart(List<MatchingPart> leadingParts, String part) {
switch (leadingParts.size()) {
case 0:
// The first part must either be a constant or a pure wildcard; expressions such as
// <code>if(or("sor","blob"))</code> are not permitte... | [
"@",
"Override",
"protected",
"MatchingPart",
"toPart",
"(",
"List",
"<",
"MatchingPart",
">",
"leadingParts",
",",
"String",
"part",
")",
"{",
"switch",
"(",
"leadingParts",
".",
"size",
"(",
")",
")",
"{",
"case",
"0",
":",
"// The first part must either be ... | Override the logic in the parent to meet the requirements for EmoPermission. | [
"Override",
"the",
"logic",
"in",
"the",
"parent",
"to",
"meet",
"the",
"requirements",
"for",
"EmoPermission",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/auth/EmoPermission.java#L86-L126 |
108,435 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/auth/EmoPermission.java | EmoPermission.createEmoPermissionPart | private MatchingPart createEmoPermissionPart(String part, PartType partType) {
part = unescapeSeparators(part);
// Superclass guarantees part will be non-empty; no need to validate length prior to evaluating the first character
switch (part.charAt(0)) {
case 'c':
// ... | java | private MatchingPart createEmoPermissionPart(String part, PartType partType) {
part = unescapeSeparators(part);
// Superclass guarantees part will be non-empty; no need to validate length prior to evaluating the first character
switch (part.charAt(0)) {
case 'c':
// ... | [
"private",
"MatchingPart",
"createEmoPermissionPart",
"(",
"String",
"part",
",",
"PartType",
"partType",
")",
"{",
"part",
"=",
"unescapeSeparators",
"(",
"part",
")",
";",
"// Superclass guarantees part will be non-empty; no need to validate length prior to evaluating the first... | Creates a TableIdentificationPart for the third value in a data or blob store permission.
@param part String representation of the part
@param partType What type of part is being evaluated | [
"Creates",
"a",
"TableIdentificationPart",
"for",
"the",
"third",
"value",
"in",
"a",
"data",
"or",
"blob",
"store",
"permission",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/auth/EmoPermission.java#L133-L183 |
108,436 | bazaarvoice/emodb | common/json/src/main/java/com/bazaarvoice/emodb/common/json/JsonStreamingArrayParser.java | JsonStreamingArrayParser.isJsonProcessingException | private boolean isJsonProcessingException(Exception e) {
// Unfortunately Jackson doesn't have specific subclasses for each parse exception, so we have to use the
// more brittle approach of checking the exception message.
return e instanceof JsonProcessingException &&
!(e instan... | java | private boolean isJsonProcessingException(Exception e) {
// Unfortunately Jackson doesn't have specific subclasses for each parse exception, so we have to use the
// more brittle approach of checking the exception message.
return e instanceof JsonProcessingException &&
!(e instan... | [
"private",
"boolean",
"isJsonProcessingException",
"(",
"Exception",
"e",
")",
"{",
"// Unfortunately Jackson doesn't have specific subclasses for each parse exception, so we have to use the",
"// more brittle approach of checking the exception message.",
"return",
"e",
"instanceof",
"Json... | Returns true if the exception is a JsonProcessingException whose root cause is not a premature end of data,
since this is more likely caused by a connection error. | [
"Returns",
"true",
"if",
"the",
"exception",
"is",
"a",
"JsonProcessingException",
"whose",
"root",
"cause",
"is",
"not",
"a",
"premature",
"end",
"of",
"data",
"since",
"this",
"is",
"more",
"likely",
"caused",
"by",
"a",
"connection",
"error",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/json/src/main/java/com/bazaarvoice/emodb/common/json/JsonStreamingArrayParser.java#L91-L98 |
108,437 | bazaarvoice/emodb | common/zookeeper/src/main/java/com/bazaarvoice/emodb/common/zookeeper/Sync.java | Sync.synchronousSync | public static boolean synchronousSync(CuratorFramework curator, Duration timeout) {
try {
// Curator sync() is always a background operation. Use a latch to block until it finishes.
final CountDownLatch latch = new CountDownLatch(1);
curator.sync().inBackground(new Backgroun... | java | public static boolean synchronousSync(CuratorFramework curator, Duration timeout) {
try {
// Curator sync() is always a background operation. Use a latch to block until it finishes.
final CountDownLatch latch = new CountDownLatch(1);
curator.sync().inBackground(new Backgroun... | [
"public",
"static",
"boolean",
"synchronousSync",
"(",
"CuratorFramework",
"curator",
",",
"Duration",
"timeout",
")",
"{",
"try",
"{",
"// Curator sync() is always a background operation. Use a latch to block until it finishes.",
"final",
"CountDownLatch",
"latch",
"=",
"new"... | Performs a blocking sync operation. Returns true if the sync completed normally, false if it timed out or
was interrupted. | [
"Performs",
"a",
"blocking",
"sync",
"operation",
".",
"Returns",
"true",
"if",
"the",
"sync",
"completed",
"normally",
"false",
"if",
"it",
"timed",
"out",
"or",
"was",
"interrupted",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/zookeeper/src/main/java/com/bazaarvoice/emodb/common/zookeeper/Sync.java#L18-L38 |
108,438 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/permissions/MatchingPermission.java | MatchingPermission.initializePermission | protected void initializePermission() {
try {
List<MatchingPart> parts = Lists.newArrayList();
for (String partString : split(_permission)) {
partString = partString.trim();
checkArgument(!"".equals(partString), "Permission cannot contain empty parts");
... | java | protected void initializePermission() {
try {
List<MatchingPart> parts = Lists.newArrayList();
for (String partString : split(_permission)) {
partString = partString.trim();
checkArgument(!"".equals(partString), "Permission cannot contain empty parts");
... | [
"protected",
"void",
"initializePermission",
"(",
")",
"{",
"try",
"{",
"List",
"<",
"MatchingPart",
">",
"parts",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
"(",
"String",
"partString",
":",
"split",
"(",
"_permission",
")",
")",
"{",
"par... | Parses and initializes the permission's parts. By default this is performed by the constructor. If a subclass
needs to perform its own initialization prior to initializing the permissions then it should call the constructor
with the initialization parameter set to false and then call this method when ready. | [
"Parses",
"and",
"initializes",
"the",
"permission",
"s",
"parts",
".",
"By",
"default",
"this",
"is",
"performed",
"by",
"the",
"constructor",
".",
"If",
"a",
"subclass",
"needs",
"to",
"perform",
"its",
"own",
"initialization",
"prior",
"to",
"initializing",... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/permissions/MatchingPermission.java#L63-L82 |
108,439 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/DefaultChangeEncoder.java | DefaultChangeEncoder.getSeparatorIndex | private int getSeparatorIndex(ByteBuffer buf) {
int colon = BufferUtils.indexOf(buf, (byte) ':');
if (colon == -1) {
throw new IllegalStateException("Unknown encoding format: " + ByteBufferUtil.bytesToHex(buf));
}
return colon;
} | java | private int getSeparatorIndex(ByteBuffer buf) {
int colon = BufferUtils.indexOf(buf, (byte) ':');
if (colon == -1) {
throw new IllegalStateException("Unknown encoding format: " + ByteBufferUtil.bytesToHex(buf));
}
return colon;
} | [
"private",
"int",
"getSeparatorIndex",
"(",
"ByteBuffer",
"buf",
")",
"{",
"int",
"colon",
"=",
"BufferUtils",
".",
"indexOf",
"(",
"buf",
",",
"(",
"byte",
")",
"'",
"'",
")",
";",
"if",
"(",
"colon",
"==",
"-",
"1",
")",
"{",
"throw",
"new",
"Ill... | Returns the index of the colon that separates the encoding prefix from the body suffix. | [
"Returns",
"the",
"index",
"of",
"the",
"colon",
"that",
"separates",
"the",
"encoding",
"prefix",
"from",
"the",
"body",
"suffix",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/DefaultChangeEncoder.java#L177-L183 |
108,440 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/ScanRange.java | ScanRange.unwrapped | public List<ScanRange> unwrapped() {
if (compare(_from, _to) < 0) {
return ImmutableList.of(this);
}
ImmutableList.Builder<ScanRange> ranges = ImmutableList.builder();
if (compare(_from, MAX_VALUE) < 0) {
ranges.add(new ScanRange(_from, MAX_VALUE));
}
... | java | public List<ScanRange> unwrapped() {
if (compare(_from, _to) < 0) {
return ImmutableList.of(this);
}
ImmutableList.Builder<ScanRange> ranges = ImmutableList.builder();
if (compare(_from, MAX_VALUE) < 0) {
ranges.add(new ScanRange(_from, MAX_VALUE));
}
... | [
"public",
"List",
"<",
"ScanRange",
">",
"unwrapped",
"(",
")",
"{",
"if",
"(",
"compare",
"(",
"_from",
",",
"_to",
")",
"<",
"0",
")",
"{",
"return",
"ImmutableList",
".",
"of",
"(",
"this",
")",
";",
"}",
"ImmutableList",
".",
"Builder",
"<",
"S... | If necessary splits the scan range into two range such that "from" is less than "to" in each range.
This is necessary if the scan range wraps the token range. | [
"If",
"necessary",
"splits",
"the",
"scan",
"range",
"into",
"two",
"range",
"such",
"that",
"from",
"is",
"less",
"than",
"to",
"in",
"each",
"range",
".",
"This",
"is",
"necessary",
"if",
"the",
"scan",
"range",
"wraps",
"the",
"token",
"range",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/ScanRange.java#L88-L100 |
108,441 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/report/ReportHistogram.java | ReportHistogram.clear | public void clear() {
_sample.clear();
_count = 0;
_max = null;
_min = null;
_sum = BigDecimal.ZERO;
_m = -1;
_s = 0;
} | java | public void clear() {
_sample.clear();
_count = 0;
_max = null;
_min = null;
_sum = BigDecimal.ZERO;
_m = -1;
_s = 0;
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"_sample",
".",
"clear",
"(",
")",
";",
"_count",
"=",
"0",
";",
"_max",
"=",
"null",
";",
"_min",
"=",
"null",
";",
"_sum",
"=",
"BigDecimal",
".",
"ZERO",
";",
"_m",
"=",
"-",
"1",
";",
"_s",
"=",
"... | Clears all recorded values. | [
"Clears",
"all",
"recorded",
"values",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/report/ReportHistogram.java#L65-L73 |
108,442 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxBlockedDataReaderDAO.java | AstyanaxBlockedDataReaderDAO.resplitLocally | @VisibleForTesting
public List<Token> resplitLocally(String startToken, String endToken, int numResplits) {
List<Token> splitTokens = ImmutableList.of(_tokenFactory.fromString(startToken), _tokenFactory.fromString(endToken));
for (int i = 0; i < numResplits; i++) {
List<Token> newTokens ... | java | @VisibleForTesting
public List<Token> resplitLocally(String startToken, String endToken, int numResplits) {
List<Token> splitTokens = ImmutableList.of(_tokenFactory.fromString(startToken), _tokenFactory.fromString(endToken));
for (int i = 0; i < numResplits; i++) {
List<Token> newTokens ... | [
"@",
"VisibleForTesting",
"public",
"List",
"<",
"Token",
">",
"resplitLocally",
"(",
"String",
"startToken",
",",
"String",
"endToken",
",",
"int",
"numResplits",
")",
"{",
"List",
"<",
"Token",
">",
"splitTokens",
"=",
"ImmutableList",
".",
"of",
"(",
"_to... | Manually split the token ranges using ByteOrderedPartitioner's midpoint method | [
"Manually",
"split",
"the",
"token",
"ranges",
"using",
"ByteOrderedPartitioner",
"s",
"midpoint",
"method"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxBlockedDataReaderDAO.java#L387-L400 |
108,443 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxBlockedDataReaderDAO.java | AstyanaxBlockedDataReaderDAO.rowQuery | private Iterator<Record> rowQuery(DeltaPlacement placement,
List<Map.Entry<ByteBuffer, Key>> keys,
ReadConsistency consistency) {
// Build the list of row IDs to query for.
List<ByteBuffer> rowIds = Lists.transform(keys, entryKe... | java | private Iterator<Record> rowQuery(DeltaPlacement placement,
List<Map.Entry<ByteBuffer, Key>> keys,
ReadConsistency consistency) {
// Build the list of row IDs to query for.
List<ByteBuffer> rowIds = Lists.transform(keys, entryKe... | [
"private",
"Iterator",
"<",
"Record",
">",
"rowQuery",
"(",
"DeltaPlacement",
"placement",
",",
"List",
"<",
"Map",
".",
"Entry",
"<",
"ByteBuffer",
",",
"Key",
">",
">",
"keys",
",",
"ReadConsistency",
"consistency",
")",
"{",
"// Build the list of row IDs to q... | Queries for rows given an enumerated list of Cassandra row keys. | [
"Queries",
"for",
"rows",
"given",
"an",
"enumerated",
"list",
"of",
"Cassandra",
"row",
"keys",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxBlockedDataReaderDAO.java#L786-L804 |
108,444 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxBlockedDataReaderDAO.java | AstyanaxBlockedDataReaderDAO.decodeKeys | private Iterator<String> decodeKeys(final Iterator<Row<ByteBuffer, DeltaKey>> iter) {
return new AbstractIterator<String>() {
@Override
protected String computeNext() {
while (iter.hasNext()) {
Row<ByteBuffer, DeltaKey> row = iter.next();
... | java | private Iterator<String> decodeKeys(final Iterator<Row<ByteBuffer, DeltaKey>> iter) {
return new AbstractIterator<String>() {
@Override
protected String computeNext() {
while (iter.hasNext()) {
Row<ByteBuffer, DeltaKey> row = iter.next();
... | [
"private",
"Iterator",
"<",
"String",
">",
"decodeKeys",
"(",
"final",
"Iterator",
"<",
"Row",
"<",
"ByteBuffer",
",",
"DeltaKey",
">",
">",
"iter",
")",
"{",
"return",
"new",
"AbstractIterator",
"<",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"prote... | Decodes row keys returned by scanning a table. | [
"Decodes",
"row",
"keys",
"returned",
"by",
"scanning",
"a",
"table",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxBlockedDataReaderDAO.java#L1035-L1048 |
108,445 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxBlockedDataReaderDAO.java | AstyanaxBlockedDataReaderDAO.decodeRows | private Iterator<Record> decodeRows(List<Map.Entry<ByteBuffer, Key>> keys, final Rows<ByteBuffer, DeltaKey> rows,
final int largeRowThreshold, final ReadConsistency consistency) {
// Avoiding pinning multiple decoded rows into memory at once.
return Iterators.tran... | java | private Iterator<Record> decodeRows(List<Map.Entry<ByteBuffer, Key>> keys, final Rows<ByteBuffer, DeltaKey> rows,
final int largeRowThreshold, final ReadConsistency consistency) {
// Avoiding pinning multiple decoded rows into memory at once.
return Iterators.tran... | [
"private",
"Iterator",
"<",
"Record",
">",
"decodeRows",
"(",
"List",
"<",
"Map",
".",
"Entry",
"<",
"ByteBuffer",
",",
"Key",
">",
">",
"keys",
",",
"final",
"Rows",
"<",
"ByteBuffer",
",",
"DeltaKey",
">",
"rows",
",",
"final",
"int",
"largeRowThreshol... | Decodes rows returned by querying for a specific set of rows. | [
"Decodes",
"rows",
"returned",
"by",
"querying",
"for",
"a",
"specific",
"set",
"of",
"rows",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxBlockedDataReaderDAO.java#L1053-L1067 |
108,446 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxBlockedDataReaderDAO.java | AstyanaxBlockedDataReaderDAO.touch | private <T> Iterator<T> touch(Iterator<T> iter) {
// Could return a Guava PeekingIterator after "if (iter.hasNext()) iter.peek()", but simply calling hasNext()
// is sufficient for the iterator implementations used by this DAO class...
iter.hasNext();
return iter;
} | java | private <T> Iterator<T> touch(Iterator<T> iter) {
// Could return a Guava PeekingIterator after "if (iter.hasNext()) iter.peek()", but simply calling hasNext()
// is sufficient for the iterator implementations used by this DAO class...
iter.hasNext();
return iter;
} | [
"private",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"touch",
"(",
"Iterator",
"<",
"T",
">",
"iter",
")",
"{",
"// Could return a Guava PeekingIterator after \"if (iter.hasNext()) iter.peek()\", but simply calling hasNext()",
"// is sufficient for the iterator implementations us... | Force computation of the first item in an iterator so metrics calculations for a method reflect the cost of
the first batch of results. | [
"Force",
"computation",
"of",
"the",
"first",
"item",
"in",
"an",
"iterator",
"so",
"metrics",
"calculations",
"for",
"a",
"method",
"reflect",
"the",
"cost",
"of",
"the",
"first",
"batch",
"of",
"results",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/AstyanaxBlockedDataReaderDAO.java#L1295-L1300 |
108,447 | bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/ConsistencyTopologyAdapter.java | ConsistencyTopologyAdapter.clamp | public ConsistencyLevel clamp(ConsistencyLevel consistencyLevel) {
// Cassandra only allows the use of LOCAL_QUORUM and EACH_QUORUM if the keyspace
// placement strategy is NetworkTopologyStrategy
if ((consistencyLevel == ConsistencyLevel.CL_LOCAL_QUORUM || consistencyLevel == ConsistencyLevel.C... | java | public ConsistencyLevel clamp(ConsistencyLevel consistencyLevel) {
// Cassandra only allows the use of LOCAL_QUORUM and EACH_QUORUM if the keyspace
// placement strategy is NetworkTopologyStrategy
if ((consistencyLevel == ConsistencyLevel.CL_LOCAL_QUORUM || consistencyLevel == ConsistencyLevel.C... | [
"public",
"ConsistencyLevel",
"clamp",
"(",
"ConsistencyLevel",
"consistencyLevel",
")",
"{",
"// Cassandra only allows the use of LOCAL_QUORUM and EACH_QUORUM if the keyspace",
"// placement strategy is NetworkTopologyStrategy",
"if",
"(",
"(",
"consistencyLevel",
"==",
"ConsistencyLe... | Reduce the desired consistency level to be compatible with the deployed ring topology. | [
"Reduce",
"the",
"desired",
"consistency",
"level",
"to",
"be",
"compatible",
"with",
"the",
"deployed",
"ring",
"topology",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/ConsistencyTopologyAdapter.java#L18-L39 |
108,448 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/StitchedColumn.java | StitchedColumn.getValue | @Override
public <V> V getValue(Serializer<V> serializer) {
return _content != null ? serializer.fromByteBuffer(_content) : _oldColumn.getValue(serializer);
} | java | @Override
public <V> V getValue(Serializer<V> serializer) {
return _content != null ? serializer.fromByteBuffer(_content) : _oldColumn.getValue(serializer);
} | [
"@",
"Override",
"public",
"<",
"V",
">",
"V",
"getValue",
"(",
"Serializer",
"<",
"V",
">",
"serializer",
")",
"{",
"return",
"_content",
"!=",
"null",
"?",
"serializer",
".",
"fromByteBuffer",
"(",
"_content",
")",
":",
"_oldColumn",
".",
"getValue",
"... | content will be null if delta fit in a single block, as no stitching was performed | [
"content",
"will",
"be",
"null",
"if",
"delta",
"fit",
"in",
"a",
"single",
"block",
"as",
"no",
"stitching",
"was",
"performed"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/StitchedColumn.java#L41-L44 |
108,449 | bazaarvoice/emodb | web-local/src/main/java/com/bazaarvoice/emodb/local/EmoServiceWithZK.java | EmoServiceWithZK.startLocalCassandra | private static void startLocalCassandra(String cassandraYamlPath) throws IOException {
System.setProperty("cassandra.config", "file:" + cassandraYamlPath);
final CassandraDaemon cassandra = new CassandraDaemon();
cassandra.init(null);
Futures.getUnchecked(service.submit(new Callable<Obj... | java | private static void startLocalCassandra(String cassandraYamlPath) throws IOException {
System.setProperty("cassandra.config", "file:" + cassandraYamlPath);
final CassandraDaemon cassandra = new CassandraDaemon();
cassandra.init(null);
Futures.getUnchecked(service.submit(new Callable<Obj... | [
"private",
"static",
"void",
"startLocalCassandra",
"(",
"String",
"cassandraYamlPath",
")",
"throws",
"IOException",
"{",
"System",
".",
"setProperty",
"(",
"\"cassandra.config\"",
",",
"\"file:\"",
"+",
"cassandraYamlPath",
")",
";",
"final",
"CassandraDaemon",
"cas... | Start an in-memory Cassandra. | [
"Start",
"an",
"in",
"-",
"memory",
"Cassandra",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web-local/src/main/java/com/bazaarvoice/emodb/local/EmoServiceWithZK.java#L148-L161 |
108,450 | bazaarvoice/emodb | web-local/src/main/java/com/bazaarvoice/emodb/local/EmoServiceWithZK.java | EmoServiceWithZK.startLocalZooKeeper | private static TestingServer startLocalZooKeeper() throws Exception {
// ZooKeeper is too noisy by default.
((Logger) LoggerFactory.getLogger("org.apache.zookeeper")).setLevel(Level.ERROR);
// Start the testing server.
TestingServer zooKeeperServer = new TestingServer(2181);
//... | java | private static TestingServer startLocalZooKeeper() throws Exception {
// ZooKeeper is too noisy by default.
((Logger) LoggerFactory.getLogger("org.apache.zookeeper")).setLevel(Level.ERROR);
// Start the testing server.
TestingServer zooKeeperServer = new TestingServer(2181);
//... | [
"private",
"static",
"TestingServer",
"startLocalZooKeeper",
"(",
")",
"throws",
"Exception",
"{",
"// ZooKeeper is too noisy by default.",
"(",
"(",
"Logger",
")",
"LoggerFactory",
".",
"getLogger",
"(",
"\"org.apache.zookeeper\"",
")",
")",
".",
"setLevel",
"(",
"Le... | Start an in-memory copy of ZooKeeper. | [
"Start",
"an",
"in",
"-",
"memory",
"copy",
"of",
"ZooKeeper",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web-local/src/main/java/com/bazaarvoice/emodb/local/EmoServiceWithZK.java#L164-L175 |
108,451 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/migrator/DeltaMigrator.java | DeltaMigrator.resubmitWorkflowTasks | public MigratorStatus resubmitWorkflowTasks(String placement) {
MigratorStatus status = _statusDAO.getMigratorStatus(placement);
if (status == null) {
return null;
}
if (status.getCompleteTime() == null) {
// Resubmit any active tasks
for (ScanRangeSt... | java | public MigratorStatus resubmitWorkflowTasks(String placement) {
MigratorStatus status = _statusDAO.getMigratorStatus(placement);
if (status == null) {
return null;
}
if (status.getCompleteTime() == null) {
// Resubmit any active tasks
for (ScanRangeSt... | [
"public",
"MigratorStatus",
"resubmitWorkflowTasks",
"(",
"String",
"placement",
")",
"{",
"MigratorStatus",
"status",
"=",
"_statusDAO",
".",
"getMigratorStatus",
"(",
"placement",
")",
";",
"if",
"(",
"status",
"==",
"null",
")",
"{",
"return",
"null",
";",
... | Sometimes due to unexpected errors while submitting migrator ranges to the underlying queues a migration can get stuck.
This method takes all available tasks for a migration and resubmits them. This method is safe because
the underlying system is resilient to task resubmissions and concurrent work on the same task. | [
"Sometimes",
"due",
"to",
"unexpected",
"errors",
"while",
"submitting",
"migrator",
"ranges",
"to",
"the",
"underlying",
"queues",
"a",
"migration",
"can",
"get",
"stuck",
".",
"This",
"method",
"takes",
"all",
"available",
"tasks",
"for",
"a",
"migration",
"... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/migrator/DeltaMigrator.java#L129-L146 |
108,452 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlDataReaderDAO.java | CqlDataReaderDAO.read | @Override
public Record read(Key key, ReadConsistency consistency) {
checkNotNull(key, "key");
checkNotNull(consistency, "consistency");
AstyanaxTable table = (AstyanaxTable) key.getTable();
AstyanaxStorage storage = table.getReadStorage();
DeltaPlacement placement = (DeltaP... | java | @Override
public Record read(Key key, ReadConsistency consistency) {
checkNotNull(key, "key");
checkNotNull(consistency, "consistency");
AstyanaxTable table = (AstyanaxTable) key.getTable();
AstyanaxStorage storage = table.getReadStorage();
DeltaPlacement placement = (DeltaP... | [
"@",
"Override",
"public",
"Record",
"read",
"(",
"Key",
"key",
",",
"ReadConsistency",
"consistency",
")",
"{",
"checkNotNull",
"(",
"key",
",",
"\"key\"",
")",
";",
"checkNotNull",
"(",
"consistency",
",",
"\"consistency\"",
")",
";",
"AstyanaxTable",
"table... | This CQL based read method works for a row with 64 deltas of 3 MB each. The same read with the AstyanaxDataReaderDAO
would give Thrift frame errors. | [
"This",
"CQL",
"based",
"read",
"method",
"works",
"for",
"a",
"row",
"with",
"64",
"deltas",
"of",
"3",
"MB",
"each",
".",
"The",
"same",
"read",
"with",
"the",
"AstyanaxDataReaderDAO",
"would",
"give",
"Thrift",
"frame",
"errors",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlDataReaderDAO.java#L158-L169 |
108,453 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlDataReaderDAO.java | CqlDataReaderDAO.getSplits | @Override
public List<String> getSplits(Table table, int recordsPerSplit, int localResplits) throws TimeoutException {
return _astyanaxReaderDAO.getSplits(table, recordsPerSplit, localResplits);
} | java | @Override
public List<String> getSplits(Table table, int recordsPerSplit, int localResplits) throws TimeoutException {
return _astyanaxReaderDAO.getSplits(table, recordsPerSplit, localResplits);
} | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"getSplits",
"(",
"Table",
"table",
",",
"int",
"recordsPerSplit",
",",
"int",
"localResplits",
")",
"throws",
"TimeoutException",
"{",
"return",
"_astyanaxReaderDAO",
".",
"getSplits",
"(",
"table",
",",
... | support for this call using CQL. Therefore they must always defer to the Asytanax implementation. | [
"support",
"for",
"this",
"call",
"using",
"CQL",
".",
"Therefore",
"they",
"must",
"always",
"defer",
"to",
"the",
"Asytanax",
"implementation",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/astyanax/CqlDataReaderDAO.java#L925-L928 |
108,454 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/LocalScanUploadMonitor.java | LocalScanUploadMonitor.resplitPartiallyCompleteTasks | private ScanStatus resplitPartiallyCompleteTasks(ScanStatus status) {
boolean anyUpdated = false;
int nextTaskId = -1;
for (ScanRangeStatus complete : status.getCompleteScanRanges()) {
if (complete.getResplitRange().isPresent()) {
// This task only partially complete... | java | private ScanStatus resplitPartiallyCompleteTasks(ScanStatus status) {
boolean anyUpdated = false;
int nextTaskId = -1;
for (ScanRangeStatus complete : status.getCompleteScanRanges()) {
if (complete.getResplitRange().isPresent()) {
// This task only partially complete... | [
"private",
"ScanStatus",
"resplitPartiallyCompleteTasks",
"(",
"ScanStatus",
"status",
")",
"{",
"boolean",
"anyUpdated",
"=",
"false",
";",
"int",
"nextTaskId",
"=",
"-",
"1",
";",
"for",
"(",
"ScanRangeStatus",
"complete",
":",
"status",
".",
"getCompleteScanRan... | Checks whether any completed tasks returned before scanning the entire range. If so then the unscanned
ranges are resplit and new tasks are created from them. | [
"Checks",
"whether",
"any",
"completed",
"tasks",
"returned",
"before",
"scanning",
"the",
"entire",
"range",
".",
"If",
"so",
"then",
"the",
"unscanned",
"ranges",
"are",
"resplit",
"and",
"new",
"tasks",
"are",
"created",
"from",
"them",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/scanner/control/LocalScanUploadMonitor.java#L282-L317 |
108,455 | bazaarvoice/emodb | common/client/src/main/java/com/bazaarvoice/emodb/client/EntityHelper.java | EntityHelper.getEntity | public static <T> T getEntity(InputStream in, Class<T> clazz) {
if (clazz == InputStream.class) {
//noinspection unchecked
return (T) clazz;
}
try {
return JsonHelper.readJson(in, clazz);
} catch (IOException e) {
throw Throwables.propagat... | java | public static <T> T getEntity(InputStream in, Class<T> clazz) {
if (clazz == InputStream.class) {
//noinspection unchecked
return (T) clazz;
}
try {
return JsonHelper.readJson(in, clazz);
} catch (IOException e) {
throw Throwables.propagat... | [
"public",
"static",
"<",
"T",
">",
"T",
"getEntity",
"(",
"InputStream",
"in",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"clazz",
"==",
"InputStream",
".",
"class",
")",
"{",
"//noinspection unchecked",
"return",
"(",
"T",
")",
"clazz"... | Reads the entity input stream and deserializes the JSON content to the given class. | [
"Reads",
"the",
"entity",
"input",
"stream",
"and",
"deserializes",
"the",
"JSON",
"content",
"to",
"the",
"given",
"class",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/client/src/main/java/com/bazaarvoice/emodb/client/EntityHelper.java#L23-L34 |
108,456 | bazaarvoice/emodb | common/client/src/main/java/com/bazaarvoice/emodb/client/EntityHelper.java | EntityHelper.typeReferenceFrom | private static <T> TypeReference<T> typeReferenceFrom(final Type type) {
return new TypeReference<T>() {
@Override
public Type getType() {
return type;
}
};
} | java | private static <T> TypeReference<T> typeReferenceFrom(final Type type) {
return new TypeReference<T>() {
@Override
public Type getType() {
return type;
}
};
} | [
"private",
"static",
"<",
"T",
">",
"TypeReference",
"<",
"T",
">",
"typeReferenceFrom",
"(",
"final",
"Type",
"type",
")",
"{",
"return",
"new",
"TypeReference",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Type",
"getType",
"(",
")",
"{"... | Internal method for creating a TypeReference from a Java Type. | [
"Internal",
"method",
"for",
"creating",
"a",
"TypeReference",
"from",
"a",
"Java",
"Type",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/client/src/main/java/com/bazaarvoice/emodb/client/EntityHelper.java#L63-L70 |
108,457 | bazaarvoice/emodb | common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StashReader.java | StashReader.getS3Client | protected static AmazonS3 getS3Client(URI stashRoot, AWSCredentialsProvider credentialsProvider) {
return getS3Client(stashRoot, credentialsProvider, null);
} | java | protected static AmazonS3 getS3Client(URI stashRoot, AWSCredentialsProvider credentialsProvider) {
return getS3Client(stashRoot, credentialsProvider, null);
} | [
"protected",
"static",
"AmazonS3",
"getS3Client",
"(",
"URI",
"stashRoot",
",",
"AWSCredentialsProvider",
"credentialsProvider",
")",
"{",
"return",
"getS3Client",
"(",
"stashRoot",
",",
"credentialsProvider",
",",
"null",
")",
";",
"}"
] | Utility method to get the S3 client for a credentials provider. | [
"Utility",
"method",
"to",
"get",
"the",
"S3",
"client",
"for",
"a",
"credentials",
"provider",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StashReader.java#L70-L72 |
108,458 | bazaarvoice/emodb | common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StashReader.java | StashReader.listTables | public Iterator<StashTable> listTables() {
final String root = getRootPath();
final String prefix = String.format("%s/", root);
return new AbstractIterator<StashTable>() {
Iterator<String> _commonPrefixes = Iterators.emptyIterator();
String _marker = null;
bo... | java | public Iterator<StashTable> listTables() {
final String root = getRootPath();
final String prefix = String.format("%s/", root);
return new AbstractIterator<StashTable>() {
Iterator<String> _commonPrefixes = Iterators.emptyIterator();
String _marker = null;
bo... | [
"public",
"Iterator",
"<",
"StashTable",
">",
"listTables",
"(",
")",
"{",
"final",
"String",
"root",
"=",
"getRootPath",
"(",
")",
";",
"final",
"String",
"prefix",
"=",
"String",
".",
"format",
"(",
"\"%s/\"",
",",
"root",
")",
";",
"return",
"new",
... | Gets all tables available in this stash. | [
"Gets",
"all",
"tables",
"available",
"in",
"this",
"stash",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StashReader.java#L154-L198 |
108,459 | bazaarvoice/emodb | common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StashReader.java | StashReader.getSplits | public List<StashSplit> getSplits(String table)
throws StashNotAvailableException, TableNotStashedException {
ImmutableList.Builder<StashSplit> splitsBuilder = ImmutableList.builder();
Iterator<S3ObjectSummary> objectSummaries = getS3ObjectSummariesForTable(table);
while (objectSumm... | java | public List<StashSplit> getSplits(String table)
throws StashNotAvailableException, TableNotStashedException {
ImmutableList.Builder<StashSplit> splitsBuilder = ImmutableList.builder();
Iterator<S3ObjectSummary> objectSummaries = getS3ObjectSummariesForTable(table);
while (objectSumm... | [
"public",
"List",
"<",
"StashSplit",
">",
"getSplits",
"(",
"String",
"table",
")",
"throws",
"StashNotAvailableException",
",",
"TableNotStashedException",
"{",
"ImmutableList",
".",
"Builder",
"<",
"StashSplit",
">",
"splitsBuilder",
"=",
"ImmutableList",
".",
"bu... | Get the splits for a record stored in stash. Each split corresponds to a file in the Stash table's directory. | [
"Get",
"the",
"splits",
"for",
"a",
"record",
"stored",
"in",
"stash",
".",
"Each",
"split",
"corresponds",
"to",
"a",
"file",
"in",
"the",
"Stash",
"table",
"s",
"directory",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StashReader.java#L306-L319 |
108,460 | bazaarvoice/emodb | databus/src/main/java/com/bazaarvoice/emodb/databus/db/cql/CqlSubscriptionDAO.java | CqlSubscriptionDAO.getColumnNames | private void getColumnNames() {
TableMetadata table = _keyspace.getKeyspaceMetadata().getTable(CF_NAME);
_rowkeyColumn = table.getPrimaryKey().get(0).getName();
_subscriptionNameColumn = table.getPrimaryKey().get(1).getName();
_subscriptionColumn = table.getColumns().get(2).getName();
... | java | private void getColumnNames() {
TableMetadata table = _keyspace.getKeyspaceMetadata().getTable(CF_NAME);
_rowkeyColumn = table.getPrimaryKey().get(0).getName();
_subscriptionNameColumn = table.getPrimaryKey().get(1).getName();
_subscriptionColumn = table.getColumns().get(2).getName();
... | [
"private",
"void",
"getColumnNames",
"(",
")",
"{",
"TableMetadata",
"table",
"=",
"_keyspace",
".",
"getKeyspaceMetadata",
"(",
")",
".",
"getTable",
"(",
"CF_NAME",
")",
";",
"_rowkeyColumn",
"=",
"table",
".",
"getPrimaryKey",
"(",
")",
".",
"get",
"(",
... | Because of the way databus tables were created historically using Astyanax and Cassandra 1.2 there may be
inconsistency in the names of the CQL columns in the subscription table. To be safe read the table metadata
to get the column names. | [
"Because",
"of",
"the",
"way",
"databus",
"tables",
"were",
"created",
"historically",
"using",
"Astyanax",
"and",
"Cassandra",
"1",
".",
"2",
"there",
"may",
"be",
"inconsistency",
"in",
"the",
"names",
"of",
"the",
"CQL",
"columns",
"in",
"the",
"subscript... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus/src/main/java/com/bazaarvoice/emodb/databus/db/cql/CqlSubscriptionDAO.java#L166-L171 |
108,461 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/tableset/BlockFileTableSet.java | BlockFileTableSet.loadTable | private int loadTable(long uuid)
throws IOException {
int bufferIndex = -1;
Set<Long> uuids = null;
// Always attempt to append to the last block first.
int blockIndex = _blocks.size() - 1;
TableBlock lastBlock = _blocks.get(blockIndex);
// Even though this ... | java | private int loadTable(long uuid)
throws IOException {
int bufferIndex = -1;
Set<Long> uuids = null;
// Always attempt to append to the last block first.
int blockIndex = _blocks.size() - 1;
TableBlock lastBlock = _blocks.get(blockIndex);
// Even though this ... | [
"private",
"int",
"loadTable",
"(",
"long",
"uuid",
")",
"throws",
"IOException",
"{",
"int",
"bufferIndex",
"=",
"-",
"1",
";",
"Set",
"<",
"Long",
">",
"uuids",
"=",
"null",
";",
"// Always attempt to append to the last block first.",
"int",
"blockIndex",
"=",... | Loads a table from the source and places it into the next available space in the table blocks.
Once the table is written it returns the index where the table is located for future reads. | [
"Loads",
"a",
"table",
"from",
"the",
"source",
"and",
"places",
"it",
"into",
"the",
"next",
"available",
"space",
"in",
"the",
"table",
"blocks",
".",
"Once",
"the",
"table",
"is",
"written",
"it",
"returns",
"the",
"index",
"where",
"the",
"table",
"i... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/tableset/BlockFileTableSet.java#L100-L131 |
108,462 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/tableset/BlockFileTableSet.java | BlockFileTableSet.readTable | private Table readTable(int index) {
// Get the block
TableBlock block = _blocks.get(getBlock(index));
// Return the table located at the block offset
return block.getTable(getBlockOffset(index));
} | java | private Table readTable(int index) {
// Get the block
TableBlock block = _blocks.get(getBlock(index));
// Return the table located at the block offset
return block.getTable(getBlockOffset(index));
} | [
"private",
"Table",
"readTable",
"(",
"int",
"index",
")",
"{",
"// Get the block",
"TableBlock",
"block",
"=",
"_blocks",
".",
"get",
"(",
"getBlock",
"(",
"index",
")",
")",
";",
"// Return the table located at the block offset",
"return",
"block",
".",
"getTabl... | Reads the table located at the given index. | [
"Reads",
"the",
"table",
"located",
"at",
"the",
"given",
"index",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/tableset/BlockFileTableSet.java#L136-L141 |
108,463 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/tableset/BlockFileTableSet.java | BlockFileTableSet.ensureBufferAvailable | private void ensureBufferAvailable(TableBlock block) throws IOException {
if (!block.hasBuffer()) {
synchronized (this) {
if (!block.hasBuffer()) {
ByteBuffer buffer = getBuffer();
block.setBuffer(buffer);
}
}
... | java | private void ensureBufferAvailable(TableBlock block) throws IOException {
if (!block.hasBuffer()) {
synchronized (this) {
if (!block.hasBuffer()) {
ByteBuffer buffer = getBuffer();
block.setBuffer(buffer);
}
}
... | [
"private",
"void",
"ensureBufferAvailable",
"(",
"TableBlock",
"block",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"block",
".",
"hasBuffer",
"(",
")",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"!",
"block",
".",
"hasBuffer",
"(... | Checks whether the given block has a buffer assigned to it. If not, it synchronously gets an available buffer
and assigns it to the block. | [
"Checks",
"whether",
"the",
"given",
"block",
"has",
"a",
"buffer",
"assigned",
"to",
"it",
".",
"If",
"not",
"it",
"synchronously",
"gets",
"an",
"available",
"buffer",
"and",
"assigns",
"it",
"to",
"the",
"block",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/tableset/BlockFileTableSet.java#L167-L176 |
108,464 | bazaarvoice/emodb | databus/src/main/java/com/bazaarvoice/emodb/databus/core/DefaultDatabus.java | DefaultDatabus.toEvents | private List<Event> toEvents(Collection<Item> items) {
if (items.isEmpty()) {
return ImmutableList.of();
}
// Sort the items to match the order of their events in an attempt to get first-in-first-out.
return items.stream().sorted().map(Item::toEvent).collect(Collectors.toLis... | java | private List<Event> toEvents(Collection<Item> items) {
if (items.isEmpty()) {
return ImmutableList.of();
}
// Sort the items to match the order of their events in an attempt to get first-in-first-out.
return items.stream().sorted().map(Item::toEvent).collect(Collectors.toLis... | [
"private",
"List",
"<",
"Event",
">",
"toEvents",
"(",
"Collection",
"<",
"Item",
">",
"items",
")",
"{",
"if",
"(",
"items",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"ImmutableList",
".",
"of",
"(",
")",
";",
"}",
"// Sort the items to match the or... | Converts a collection of Items to Events. | [
"Converts",
"a",
"collection",
"of",
"Items",
"to",
"Events",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus/src/main/java/com/bazaarvoice/emodb/databus/core/DefaultDatabus.java#L765-L772 |
108,465 | bazaarvoice/emodb | databus/src/main/java/com/bazaarvoice/emodb/databus/core/DefaultDatabus.java | DefaultDatabus.unclaim | private void unclaim(String subscription, Collection<EventList> eventLists) {
List<String> eventIdsToUnclaim = Lists.newArrayList();
for (EventList unclaimEvents : eventLists) {
for (Pair<String, UUID> eventAndChangeId : unclaimEvents.getEventAndChangeIds()) {
eventIdsToUncla... | java | private void unclaim(String subscription, Collection<EventList> eventLists) {
List<String> eventIdsToUnclaim = Lists.newArrayList();
for (EventList unclaimEvents : eventLists) {
for (Pair<String, UUID> eventAndChangeId : unclaimEvents.getEventAndChangeIds()) {
eventIdsToUncla... | [
"private",
"void",
"unclaim",
"(",
"String",
"subscription",
",",
"Collection",
"<",
"EventList",
">",
"eventLists",
")",
"{",
"List",
"<",
"String",
">",
"eventIdsToUnclaim",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
"(",
"EventList",
"unclai... | Convenience method to unclaim all of the events from a collection of event lists. This is to unclaim excess
events when a padded poll returns more events than the requested limit. | [
"Convenience",
"method",
"to",
"unclaim",
"all",
"of",
"the",
"events",
"from",
"a",
"collection",
"of",
"event",
"lists",
".",
"This",
"is",
"to",
"unclaim",
"excess",
"events",
"when",
"a",
"padded",
"poll",
"returns",
"more",
"events",
"than",
"the",
"r... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus/src/main/java/com/bazaarvoice/emodb/databus/core/DefaultDatabus.java#L778-L787 |
108,466 | bazaarvoice/emodb | common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java | EmoUriComponent.encode | public static String encode(String s, Type t) {
return _encode(s, t, false, false);
} | java | public static String encode(String s, Type t) {
return _encode(s, t, false, false);
} | [
"public",
"static",
"String",
"encode",
"(",
"String",
"s",
",",
"Type",
"t",
")",
"{",
"return",
"_encode",
"(",
"s",
",",
"t",
",",
"false",
",",
"false",
")",
";",
"}"
] | Encodes the characters of string that are either non-ASCII characters
or are ASCII characters that must be percent-encoded using the
UTF-8 encoding.
@param s the string to be encoded.
@param t the URI component type identifying the ASCII characters that
must be percent-encoded.
@return the encoded string. | [
"Encodes",
"the",
"characters",
"of",
"string",
"that",
"are",
"either",
"non",
"-",
"ASCII",
"characters",
"or",
"are",
"ASCII",
"characters",
"that",
"must",
"be",
"percent",
"-",
"encoded",
"using",
"the",
"UTF",
"-",
"8",
"encoding",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java#L197-L199 |
108,467 | bazaarvoice/emodb | common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java | EmoUriComponent.decodePath | public static List<PathSegment> decodePath(URI u, boolean decode) {
String rawPath = u.getRawPath();
if (rawPath != null && rawPath.length() > 0 && rawPath.charAt(0) == '/') {
rawPath = rawPath.substring(1);
}
return decodePath(rawPath, decode);
} | java | public static List<PathSegment> decodePath(URI u, boolean decode) {
String rawPath = u.getRawPath();
if (rawPath != null && rawPath.length() > 0 && rawPath.charAt(0) == '/') {
rawPath = rawPath.substring(1);
}
return decodePath(rawPath, decode);
} | [
"public",
"static",
"List",
"<",
"PathSegment",
">",
"decodePath",
"(",
"URI",
"u",
",",
"boolean",
"decode",
")",
"{",
"String",
"rawPath",
"=",
"u",
".",
"getRawPath",
"(",
")",
";",
"if",
"(",
"rawPath",
"!=",
"null",
"&&",
"rawPath",
".",
"length",... | Decode the path component of a URI as path segments.
@param u the URI. If the path component is an absolute path component
then the leading '/' is ignored and is not considered a delimiator
of a path segment.
@param decode true if the path segments of the path component
should be in decoded form.
@return the list... | [
"Decode",
"the",
"path",
"component",
"of",
"a",
"URI",
"as",
"path",
"segments",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java#L590-L596 |
108,468 | bazaarvoice/emodb | common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java | EmoUriComponent.decodePathSegment | public static void decodePathSegment(List<PathSegment> segments, String segment, boolean decode) {
int colon = segment.indexOf(';');
if (colon != -1) {
segments.add(new PathSegmentImpl(
(colon == 0) ? "" : segment.substring(0, colon),
decode,
... | java | public static void decodePathSegment(List<PathSegment> segments, String segment, boolean decode) {
int colon = segment.indexOf(';');
if (colon != -1) {
segments.add(new PathSegmentImpl(
(colon == 0) ? "" : segment.substring(0, colon),
decode,
... | [
"public",
"static",
"void",
"decodePathSegment",
"(",
"List",
"<",
"PathSegment",
">",
"segments",
",",
"String",
"segment",
",",
"boolean",
"decode",
")",
"{",
"int",
"colon",
"=",
"segment",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"colon",
... | Decode the path segment and add it to the list of path segments.
@param segments mutable list of path segments.
@param segment path segment to be decoded.
@param decode {@code true} if the path segment should be in a decoded form. | [
"Decode",
"the",
"path",
"segment",
"and",
"add",
"it",
"to",
"the",
"list",
"of",
"path",
"segments",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java#L648-L660 |
108,469 | bazaarvoice/emodb | common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java | EmoUriComponent.decodeMatrix | public static MultivaluedMap<String, String> decodeMatrix(String pathSegment, boolean decode) {
// EMODB-MODIFICATION Replaced with EmoMultivaluedMap implementation
MultivaluedMap<String, String> matrixMap = EmoMultivaluedMap.create();
// Skip over path segment
int s = pathSegment.index... | java | public static MultivaluedMap<String, String> decodeMatrix(String pathSegment, boolean decode) {
// EMODB-MODIFICATION Replaced with EmoMultivaluedMap implementation
MultivaluedMap<String, String> matrixMap = EmoMultivaluedMap.create();
// Skip over path segment
int s = pathSegment.index... | [
"public",
"static",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"decodeMatrix",
"(",
"String",
"pathSegment",
",",
"boolean",
"decode",
")",
"{",
"// EMODB-MODIFICATION Replaced with EmoMultivaluedMap implementation",
"MultivaluedMap",
"<",
"String",
",",
"String... | Decode the matrix component of a URI path segment.
@param pathSegment the path segment component in encoded form.
@param decode true if the matrix parameters of the path segment component
should be in decoded form.
@return the multivalued map of matrix parameters. | [
"Decode",
"the",
"matrix",
"component",
"of",
"a",
"URI",
"path",
"segment",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java#L670-L692 |
108,470 | bazaarvoice/emodb | common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java | EmoUriComponent.decodeOctets | private static int decodeOctets(int i, ByteBuffer bb, StringBuilder sb) {
// If there is only one octet and is an ASCII character
if (bb.limit() == 1 && (bb.get(0) & 0xFF) < 0x80) {
// Octet can be appended directly
sb.append((char) bb.get(0));
return i + 2;
}... | java | private static int decodeOctets(int i, ByteBuffer bb, StringBuilder sb) {
// If there is only one octet and is an ASCII character
if (bb.limit() == 1 && (bb.get(0) & 0xFF) < 0x80) {
// Octet can be appended directly
sb.append((char) bb.get(0));
return i + 2;
}... | [
"private",
"static",
"int",
"decodeOctets",
"(",
"int",
"i",
",",
"ByteBuffer",
"bb",
",",
"StringBuilder",
"sb",
")",
"{",
"// If there is only one octet and is an ASCII character",
"if",
"(",
"bb",
".",
"limit",
"(",
")",
"==",
"1",
"&&",
"(",
"bb",
".",
"... | Decodes octets to characters using the UTF-8 decoding and appends
the characters to a StringBuffer.
@return the index to the next unchecked character in the string to decode | [
"Decodes",
"octets",
"to",
"characters",
"using",
"the",
"UTF",
"-",
"8",
"decoding",
"and",
"appends",
"the",
"characters",
"to",
"a",
"StringBuffer",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/client/src/main/java/com/bazaarvoice/emodb/client/uri/EmoUriComponent.java#L822-L834 |
108,471 | bazaarvoice/emodb | auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/shiro/PrincipalWithRoles.java | PrincipalWithRoles.toUserIdentity | public UserIdentity toUserIdentity() {
if (_userIdentity == null) {
String[] roles = _roles.toArray(new String[_roles.size()]);
_userIdentity = new DefaultUserIdentity(
new javax.security.auth.Subject(true, ImmutableSet.of(this), ImmutableSet.of(), ImmutableSet.of())... | java | public UserIdentity toUserIdentity() {
if (_userIdentity == null) {
String[] roles = _roles.toArray(new String[_roles.size()]);
_userIdentity = new DefaultUserIdentity(
new javax.security.auth.Subject(true, ImmutableSet.of(this), ImmutableSet.of(), ImmutableSet.of())... | [
"public",
"UserIdentity",
"toUserIdentity",
"(",
")",
"{",
"if",
"(",
"_userIdentity",
"==",
"null",
")",
"{",
"String",
"[",
"]",
"roles",
"=",
"_roles",
".",
"toArray",
"(",
"new",
"String",
"[",
"_roles",
".",
"size",
"(",
")",
"]",
")",
";",
"_us... | Returns this instance as a Jetty UserIdentity. The returned instance is immutable and cached. | [
"Returns",
"this",
"instance",
"as",
"a",
"Jetty",
"UserIdentity",
".",
"The",
"returned",
"instance",
"is",
"immutable",
"and",
"cached",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/auth/auth-core/src/main/java/com/bazaarvoice/emodb/auth/shiro/PrincipalWithRoles.java#L47-L56 |
108,472 | bazaarvoice/emodb | common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/RestartingS3InputStream.java | RestartingS3InputStream.reopenS3InputStream | private void reopenS3InputStream()
throws IOException {
// First attempt to close the existing input stream
try {
closeS3InputStream();
} catch (IOException ignore) {
// Ignore this exception; we're re-opening because there was in issue with the existing strea... | java | private void reopenS3InputStream()
throws IOException {
// First attempt to close the existing input stream
try {
closeS3InputStream();
} catch (IOException ignore) {
// Ignore this exception; we're re-opening because there was in issue with the existing strea... | [
"private",
"void",
"reopenS3InputStream",
"(",
")",
"throws",
"IOException",
"{",
"// First attempt to close the existing input stream",
"try",
"{",
"closeS3InputStream",
"(",
")",
";",
"}",
"catch",
"(",
"IOException",
"ignore",
")",
"{",
"// Ignore this exception; we're... | Re-opens the input stream, starting at the first unread byte. | [
"Re",
"-",
"opens",
"the",
"input",
"stream",
"starting",
"at",
"the",
"first",
"unread",
"byte",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/RestartingS3InputStream.java#L137-L172 |
108,473 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/TableJson.java | TableJson.newDropTable | Delta newDropTable() {
Delta storageDelta = Deltas.mapBuilder()
.put(StorageState.DROPPED.getMarkerAttribute().key(), now())
.build();
MapDeltaBuilder storageMapDelta = Deltas.mapBuilder();
if (_master != null) {
for (Storage storage : _master.getPrim... | java | Delta newDropTable() {
Delta storageDelta = Deltas.mapBuilder()
.put(StorageState.DROPPED.getMarkerAttribute().key(), now())
.build();
MapDeltaBuilder storageMapDelta = Deltas.mapBuilder();
if (_master != null) {
for (Storage storage : _master.getPrim... | [
"Delta",
"newDropTable",
"(",
")",
"{",
"Delta",
"storageDelta",
"=",
"Deltas",
".",
"mapBuilder",
"(",
")",
".",
"put",
"(",
"StorageState",
".",
"DROPPED",
".",
"getMarkerAttribute",
"(",
")",
".",
"key",
"(",
")",
",",
"now",
"(",
")",
")",
".",
"... | Mark an entire table as dropped. A maintenance job will come along later and actually purge the data. | [
"Mark",
"an",
"entire",
"table",
"as",
"dropped",
".",
"A",
"maintenance",
"job",
"will",
"come",
"along",
"later",
"and",
"actually",
"purge",
"the",
"data",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/TableJson.java#L175-L200 |
108,474 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/TableJson.java | TableJson.newDropFacade | Delta newDropFacade(Storage facade) {
Delta storageDelta = Deltas.mapBuilder()
.put(StorageState.DROPPED.getMarkerAttribute().key(), now())
.build();
MapDeltaBuilder storageMapDelta = Deltas.mapBuilder();
for (Storage storage : facade.getPrimaryAndMirrors()) {
... | java | Delta newDropFacade(Storage facade) {
Delta storageDelta = Deltas.mapBuilder()
.put(StorageState.DROPPED.getMarkerAttribute().key(), now())
.build();
MapDeltaBuilder storageMapDelta = Deltas.mapBuilder();
for (Storage storage : facade.getPrimaryAndMirrors()) {
... | [
"Delta",
"newDropFacade",
"(",
"Storage",
"facade",
")",
"{",
"Delta",
"storageDelta",
"=",
"Deltas",
".",
"mapBuilder",
"(",
")",
".",
"put",
"(",
"StorageState",
".",
"DROPPED",
".",
"getMarkerAttribute",
"(",
")",
".",
"key",
"(",
")",
",",
"now",
"("... | Mark a facade as dropped. A maintenance job will come along later and actually purge the data. | [
"Mark",
"a",
"facade",
"as",
"dropped",
".",
"A",
"maintenance",
"job",
"will",
"come",
"along",
"later",
"and",
"actually",
"purge",
"the",
"data",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/TableJson.java#L203-L216 |
108,475 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/TableJson.java | TableJson.newMoveStart | Delta newMoveStart(Storage src, String destUuid, String destPlacement, int destShardsLog2) {
return Deltas.mapBuilder()
.update(STORAGE.key(), Deltas.mapBuilder()
.update(src.getUuidString(), Deltas.mapBuilder()
.put(Storage.MOVE_TO.key(), ... | java | Delta newMoveStart(Storage src, String destUuid, String destPlacement, int destShardsLog2) {
return Deltas.mapBuilder()
.update(STORAGE.key(), Deltas.mapBuilder()
.update(src.getUuidString(), Deltas.mapBuilder()
.put(Storage.MOVE_TO.key(), ... | [
"Delta",
"newMoveStart",
"(",
"Storage",
"src",
",",
"String",
"destUuid",
",",
"String",
"destPlacement",
",",
"int",
"destShardsLog2",
")",
"{",
"return",
"Deltas",
".",
"mapBuilder",
"(",
")",
".",
"update",
"(",
"STORAGE",
".",
"key",
"(",
")",
",",
... | First step in a move, creates the destination storage and sets up mirroring. | [
"First",
"step",
"in",
"a",
"move",
"creates",
"the",
"destination",
"storage",
"and",
"sets",
"up",
"mirroring",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/TableJson.java#L236-L248 |
108,476 | bazaarvoice/emodb | table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/TableJson.java | TableJson.newMoveRestart | Delta newMoveRestart(Storage src, Storage dest) {
// If the destination used to be the initial primary for the group, it's consistent and ready to promote
// but lacking the MIRROR_CONSISTENT marker attribute which is the prereq for promotion. Add one.
Delta consistentMarker = dest.isConsistent... | java | Delta newMoveRestart(Storage src, Storage dest) {
// If the destination used to be the initial primary for the group, it's consistent and ready to promote
// but lacking the MIRROR_CONSISTENT marker attribute which is the prereq for promotion. Add one.
Delta consistentMarker = dest.isConsistent... | [
"Delta",
"newMoveRestart",
"(",
"Storage",
"src",
",",
"Storage",
"dest",
")",
"{",
"// If the destination used to be the initial primary for the group, it's consistent and ready to promote",
"// but lacking the MIRROR_CONSISTENT marker attribute which is the prereq for promotion. Add one.",
... | Start a move to an existing mirror that may or may not have once been primary. | [
"Start",
"a",
"move",
"to",
"an",
"existing",
"mirror",
"that",
"may",
"or",
"may",
"not",
"have",
"once",
"been",
"primary",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/table/src/main/java/com/bazaarvoice/emodb/table/db/astyanax/TableJson.java#L268-L290 |
108,477 | bazaarvoice/emodb | sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStash.java | DataStoreStash.listStashTables | public Iterable<StashTable> listStashTables()
throws StashNotAvailableException {
final StashReader stashReader = _stashReader.getLockedView();
return new Iterable<StashTable>() {
@Override
public Iterator<StashTable> iterator() {
return stashReader.l... | java | public Iterable<StashTable> listStashTables()
throws StashNotAvailableException {
final StashReader stashReader = _stashReader.getLockedView();
return new Iterable<StashTable>() {
@Override
public Iterator<StashTable> iterator() {
return stashReader.l... | [
"public",
"Iterable",
"<",
"StashTable",
">",
"listStashTables",
"(",
")",
"throws",
"StashNotAvailableException",
"{",
"final",
"StashReader",
"stashReader",
"=",
"_stashReader",
".",
"getLockedView",
"(",
")",
";",
"return",
"new",
"Iterable",
"<",
"StashTable",
... | Lists all tables present in Stash. Note that tables that were present in EmoDB but empty during the
Stash operation are not listed. | [
"Lists",
"all",
"tables",
"present",
"in",
"Stash",
".",
"Note",
"that",
"tables",
"that",
"were",
"present",
"in",
"EmoDB",
"but",
"empty",
"during",
"the",
"Stash",
"operation",
"are",
"not",
"listed",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStash.java#L145-L155 |
108,478 | bazaarvoice/emodb | sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStash.java | DataStoreStash.scan | public StashRowIterable scan(final String table)
throws StashNotAvailableException, TableNotStashedException {
try {
final StashReader stashReader = _stashReader.getLockedView();
return new StashRowIterable() {
@Override
protected StashRowIter... | java | public StashRowIterable scan(final String table)
throws StashNotAvailableException, TableNotStashedException {
try {
final StashReader stashReader = _stashReader.getLockedView();
return new StashRowIterable() {
@Override
protected StashRowIter... | [
"public",
"StashRowIterable",
"scan",
"(",
"final",
"String",
"table",
")",
"throws",
"StashNotAvailableException",
",",
"TableNotStashedException",
"{",
"try",
"{",
"final",
"StashReader",
"stashReader",
"=",
"_stashReader",
".",
"getLockedView",
"(",
")",
";",
"re... | Scans all rows from Stash for the given table. | [
"Scans",
"all",
"rows",
"from",
"Stash",
"for",
"the",
"given",
"table",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStash.java#L204-L218 |
108,479 | bazaarvoice/emodb | sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStash.java | DataStoreStash.getSplits | public Collection<String> getSplits(String table)
throws StashNotAvailableException, TableNotStashedException {
try {
return FluentIterable.from(_stashReader.getSplits(table))
.transform(Functions.toStringFunction())
.toList();
} catch (Tab... | java | public Collection<String> getSplits(String table)
throws StashNotAvailableException, TableNotStashedException {
try {
return FluentIterable.from(_stashReader.getSplits(table))
.transform(Functions.toStringFunction())
.toList();
} catch (Tab... | [
"public",
"Collection",
"<",
"String",
">",
"getSplits",
"(",
"String",
"table",
")",
"throws",
"StashNotAvailableException",
",",
"TableNotStashedException",
"{",
"try",
"{",
"return",
"FluentIterable",
".",
"from",
"(",
"_stashReader",
".",
"getSplits",
"(",
"ta... | Gets the splits from Stash for the given table. | [
"Gets",
"the",
"splits",
"from",
"Stash",
"for",
"the",
"given",
"table",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStash.java#L223-L232 |
108,480 | bazaarvoice/emodb | sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStash.java | DataStoreStash.propagateTableNotStashed | private RuntimeException propagateTableNotStashed(TableNotStashedException e)
throws TableNotStashedException, UnknownTableException {
if (_dataStore.getTableExists(e.getTable())) {
throw e;
}
throw new UnknownTableException(e.getTable());
} | java | private RuntimeException propagateTableNotStashed(TableNotStashedException e)
throws TableNotStashedException, UnknownTableException {
if (_dataStore.getTableExists(e.getTable())) {
throw e;
}
throw new UnknownTableException(e.getTable());
} | [
"private",
"RuntimeException",
"propagateTableNotStashed",
"(",
"TableNotStashedException",
"e",
")",
"throws",
"TableNotStashedException",
",",
"UnknownTableException",
"{",
"if",
"(",
"_dataStore",
".",
"getTableExists",
"(",
"e",
".",
"getTable",
"(",
")",
")",
")"... | If a table exists but is empty then it will not be stashed. This method will surface this exception
only if the table exists. Otherwise it converts it to an UnknownTableException. | [
"If",
"a",
"table",
"exists",
"but",
"is",
"empty",
"then",
"it",
"will",
"not",
"be",
"stashed",
".",
"This",
"method",
"will",
"surface",
"this",
"exception",
"only",
"if",
"the",
"table",
"exists",
".",
"Otherwise",
"it",
"converts",
"it",
"to",
"an",... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor-client-common/src/main/java/com/bazaarvoice/emodb/sor/client/DataStoreStash.java#L259-L265 |
108,481 | bazaarvoice/emodb | common/api/src/main/java/com/bazaarvoice/emodb/common/api/Names.java | Names.isLegalRoleName | public static boolean isLegalRoleName(String role) {
return role != null &&
role.length() > 0 && role.length() <= 255 &&
ROLE_NAME_ALLOWED.matchesAllOf(role);
} | java | public static boolean isLegalRoleName(String role) {
return role != null &&
role.length() > 0 && role.length() <= 255 &&
ROLE_NAME_ALLOWED.matchesAllOf(role);
} | [
"public",
"static",
"boolean",
"isLegalRoleName",
"(",
"String",
"role",
")",
"{",
"return",
"role",
"!=",
"null",
"&&",
"role",
".",
"length",
"(",
")",
">",
"0",
"&&",
"role",
".",
"length",
"(",
")",
"<=",
"255",
"&&",
"ROLE_NAME_ALLOWED",
".",
"mat... | Role names mostly follow the same conventions as table names except, since they are only used internally, are
slightly more permissive, such as allowing capital letters. | [
"Role",
"names",
"mostly",
"follow",
"the",
"same",
"conventions",
"as",
"table",
"names",
"except",
"since",
"they",
"are",
"only",
"used",
"internally",
"are",
"slightly",
"more",
"permissive",
"such",
"as",
"allowing",
"capital",
"letters",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/api/src/main/java/com/bazaarvoice/emodb/common/api/Names.java#L44-L48 |
108,482 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java | EmoTableAllTablesReportDAO.verifyOrCreateReport | @Override
public void verifyOrCreateReport(String reportId) {
checkNotNull(reportId, "reportId");
String tableName = getTableName(reportId);
if (_dataStore.getTableExists(tableName)) {
return; // Nothing to do.
}
try {
// TODO: when run in the EU th... | java | @Override
public void verifyOrCreateReport(String reportId) {
checkNotNull(reportId, "reportId");
String tableName = getTableName(reportId);
if (_dataStore.getTableExists(tableName)) {
return; // Nothing to do.
}
try {
// TODO: when run in the EU th... | [
"@",
"Override",
"public",
"void",
"verifyOrCreateReport",
"(",
"String",
"reportId",
")",
"{",
"checkNotNull",
"(",
"reportId",
",",
"\"reportId\"",
")",
";",
"String",
"tableName",
"=",
"getTableName",
"(",
"reportId",
")",
";",
"if",
"(",
"_dataStore",
".",... | Verifies that the given report table exists or, if not, creates it. | [
"Verifies",
"that",
"the",
"given",
"report",
"table",
"exists",
"or",
"if",
"not",
"creates",
"it",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java#L64-L83 |
108,483 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java | EmoTableAllTablesReportDAO.updateReport | @Override
public void updateReport(AllTablesReportDelta delta) {
checkNotNull(delta, "delta");
updateMetadata(delta);
if (delta.getTable().isPresent()) {
updateTableData(delta, delta.getTable().get());
}
} | java | @Override
public void updateReport(AllTablesReportDelta delta) {
checkNotNull(delta, "delta");
updateMetadata(delta);
if (delta.getTable().isPresent()) {
updateTableData(delta, delta.getTable().get());
}
} | [
"@",
"Override",
"public",
"void",
"updateReport",
"(",
"AllTablesReportDelta",
"delta",
")",
"{",
"checkNotNull",
"(",
"delta",
",",
"\"delta\"",
")",
";",
"updateMetadata",
"(",
"delta",
")",
";",
"if",
"(",
"delta",
".",
"getTable",
"(",
")",
".",
"isPr... | Updates the metadata associated with the report. | [
"Updates",
"the",
"metadata",
"associated",
"with",
"the",
"report",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java#L88-L97 |
108,484 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java | EmoTableAllTablesReportDAO.getReportMetadata | @Override
public TableReportMetadata getReportMetadata(String reportId) {
checkNotNull(reportId, "reportId");
final String reportTable = getTableName(reportId);
Map<String, Object> metadata;
try {
metadata = _dataStore.get(reportTable, REPORT_METADATA_KEY);
} ca... | java | @Override
public TableReportMetadata getReportMetadata(String reportId) {
checkNotNull(reportId, "reportId");
final String reportTable = getTableName(reportId);
Map<String, Object> metadata;
try {
metadata = _dataStore.get(reportTable, REPORT_METADATA_KEY);
} ca... | [
"@",
"Override",
"public",
"TableReportMetadata",
"getReportMetadata",
"(",
"String",
"reportId",
")",
"{",
"checkNotNull",
"(",
"reportId",
",",
"\"reportId\"",
")",
";",
"final",
"String",
"reportTable",
"=",
"getTableName",
"(",
"reportId",
")",
";",
"Map",
"... | Returns the table data for a given report. The caller can optionally return a partial report with ony
the requested tables. | [
"Returns",
"the",
"table",
"data",
"for",
"a",
"given",
"report",
".",
"The",
"caller",
"can",
"optionally",
"return",
"a",
"partial",
"report",
"with",
"ony",
"the",
"requested",
"tables",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java#L164-L199 |
108,485 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java | EmoTableAllTablesReportDAO.getReportEntries | @Override
public Iterable<TableReportEntry> getReportEntries(String reportId, final AllTablesReportQuery query) {
checkNotNull(reportId, "reportId");
final String reportTable = getTableName(reportId);
// Set up several filters based on the query attributes
final Predicate<String> ... | java | @Override
public Iterable<TableReportEntry> getReportEntries(String reportId, final AllTablesReportQuery query) {
checkNotNull(reportId, "reportId");
final String reportTable = getTableName(reportId);
// Set up several filters based on the query attributes
final Predicate<String> ... | [
"@",
"Override",
"public",
"Iterable",
"<",
"TableReportEntry",
">",
"getReportEntries",
"(",
"String",
"reportId",
",",
"final",
"AllTablesReportQuery",
"query",
")",
"{",
"checkNotNull",
"(",
"reportId",
",",
"\"reportId\"",
")",
";",
"final",
"String",
"reportT... | Returns the matching table report entries for a report ID and query parameters. | [
"Returns",
"the",
"matching",
"table",
"report",
"entries",
"for",
"a",
"report",
"ID",
"and",
"query",
"parameters",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java#L204-L249 |
108,486 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java | EmoTableAllTablesReportDAO.queryDataStoreForTableReportResults | private Iterator<Map<String, Object>> queryDataStoreForTableReportResults(final String reportTable, final AllTablesReportQuery query) {
if (!query.getTableNames().isEmpty()) {
// Querying for a specific set of tables.
return Iterators.concat(
Iterators.transform(
... | java | private Iterator<Map<String, Object>> queryDataStoreForTableReportResults(final String reportTable, final AllTablesReportQuery query) {
if (!query.getTableNames().isEmpty()) {
// Querying for a specific set of tables.
return Iterators.concat(
Iterators.transform(
... | [
"private",
"Iterator",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"queryDataStoreForTableReportResults",
"(",
"final",
"String",
"reportTable",
",",
"final",
"AllTablesReportQuery",
"query",
")",
"{",
"if",
"(",
"!",
"query",
".",
"getTableNames",
"(",
... | Returns an iterator of report results based on the query configuration. The results are guaranteed to be a
superset of results matching the original query; further filtering may be required to exactly match the
query. | [
"Returns",
"an",
"iterator",
"of",
"report",
"results",
"based",
"on",
"the",
"query",
"configuration",
".",
"The",
"results",
"are",
"guaranteed",
"to",
"be",
"a",
"superset",
"of",
"results",
"matching",
"the",
"original",
"query",
";",
"further",
"filtering... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java#L256-L300 |
108,487 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java | EmoTableAllTablesReportDAO.convertToTableReportEntry | @Nullable
private TableReportEntry convertToTableReportEntry(Map<String, Object> map, Predicate<String> placementFilter,
Predicate<Boolean> droppedFilter, Predicate<Boolean> facadeFilter) {
if (Intrinsic.isDeleted(map)) {
return null;
... | java | @Nullable
private TableReportEntry convertToTableReportEntry(Map<String, Object> map, Predicate<String> placementFilter,
Predicate<Boolean> droppedFilter, Predicate<Boolean> facadeFilter) {
if (Intrinsic.isDeleted(map)) {
return null;
... | [
"@",
"Nullable",
"private",
"TableReportEntry",
"convertToTableReportEntry",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
",",
"Predicate",
"<",
"String",
">",
"placementFilter",
",",
"Predicate",
"<",
"Boolean",
">",
"droppedFilter",
",",
"Predicate",
... | Accepts a row from the table report and returns it converted into a TableReportEntry. If the row is deleted
or if it doesn't match all of the configured filters then null is returned. | [
"Accepts",
"a",
"row",
"from",
"the",
"table",
"report",
"and",
"returns",
"it",
"converted",
"into",
"a",
"TableReportEntry",
".",
"If",
"the",
"row",
"is",
"deleted",
"or",
"if",
"it",
"doesn",
"t",
"match",
"all",
"of",
"the",
"configured",
"filters",
... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java#L306-L332 |
108,488 | bazaarvoice/emodb | web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java | EmoTableAllTablesReportDAO.convertToTableReportEntryTable | @Nullable
private TableReportEntryTable convertToTableReportEntryTable(
String tableId, Map<String, Object> map, Predicate<String> placementFilter,
Predicate<Boolean> droppedFilter, Predicate<Boolean> facadeFilter) {
// Check the filters for placement, dropped, and facade
... | java | @Nullable
private TableReportEntryTable convertToTableReportEntryTable(
String tableId, Map<String, Object> map, Predicate<String> placementFilter,
Predicate<Boolean> droppedFilter, Predicate<Boolean> facadeFilter) {
// Check the filters for placement, dropped, and facade
... | [
"@",
"Nullable",
"private",
"TableReportEntryTable",
"convertToTableReportEntryTable",
"(",
"String",
"tableId",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
",",
"Predicate",
"<",
"String",
">",
"placementFilter",
",",
"Predicate",
"<",
"Boolean",
">",
... | Accepts the table portion of a table report entry and converts it to a TableReportEntryTable. If the
entry doesn't match all of the configured filters then null is returned. | [
"Accepts",
"the",
"table",
"portion",
"of",
"a",
"table",
"report",
"entry",
"and",
"converts",
"it",
"to",
"a",
"TableReportEntryTable",
".",
"If",
"the",
"entry",
"doesn",
"t",
"match",
"all",
"of",
"the",
"configured",
"filters",
"then",
"null",
"is",
"... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/web/src/main/java/com/bazaarvoice/emodb/web/report/db/EmoTableAllTablesReportDAO.java#L338-L387 |
108,489 | bazaarvoice/emodb | databus-api/src/main/java/com/bazaarvoice/emodb/databus/api/Event.java | Event.getJsonSerializingContent | @JsonView(EventViews.ContentOnly.class)
@JsonProperty("content")
private Map<String, Object> getJsonSerializingContent() {
//noinspection unchecked
return (Map<String, Object>) _content;
} | java | @JsonView(EventViews.ContentOnly.class)
@JsonProperty("content")
private Map<String, Object> getJsonSerializingContent() {
//noinspection unchecked
return (Map<String, Object>) _content;
} | [
"@",
"JsonView",
"(",
"EventViews",
".",
"ContentOnly",
".",
"class",
")",
"@",
"JsonProperty",
"(",
"\"content\"",
")",
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"getJsonSerializingContent",
"(",
")",
"{",
"//noinspection unchecked",
"return",
"(",
... | For purposes of JSON serialization wrapping the content in an unmodifiable view may cause the serializer
to choose a less-optimal implementation. Since JSON serialization cannot modify the underlying content
it is safe to return the original content object to the serializer. | [
"For",
"purposes",
"of",
"JSON",
"serialization",
"wrapping",
"the",
"content",
"in",
"an",
"unmodifiable",
"view",
"may",
"cause",
"the",
"serializer",
"to",
"choose",
"a",
"less",
"-",
"optimal",
"implementation",
".",
"Since",
"JSON",
"serialization",
"cannot... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus-api/src/main/java/com/bazaarvoice/emodb/databus/api/Event.java#L45-L50 |
108,490 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/DeltaIterator.java | DeltaIterator.reverseCompute | private BlockedDelta reverseCompute() {
int contentSize = getValue(_next).remaining();
UUID correctChangeId = getChangeId(_next);
int numBlocks = 1;
if (_list == null) {
_list = Lists.newArrayListWithCapacity(3);
}
_list.add(_next);
_oldDelta = _ne... | java | private BlockedDelta reverseCompute() {
int contentSize = getValue(_next).remaining();
UUID correctChangeId = getChangeId(_next);
int numBlocks = 1;
if (_list == null) {
_list = Lists.newArrayListWithCapacity(3);
}
_list.add(_next);
_oldDelta = _ne... | [
"private",
"BlockedDelta",
"reverseCompute",
"(",
")",
"{",
"int",
"contentSize",
"=",
"getValue",
"(",
"_next",
")",
".",
"remaining",
"(",
")",
";",
"UUID",
"correctChangeId",
"=",
"getChangeId",
"(",
"_next",
")",
";",
"int",
"numBlocks",
"=",
"1",
";",... | stitch delta together in reverse | [
"stitch",
"delta",
"together",
"in",
"reverse"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/DeltaIterator.java#L38-L77 |
108,491 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/DeltaIterator.java | DeltaIterator.compute | private BlockedDelta compute(int numBlocks) {
int contentSize = getValue(_next).remaining();
_oldDelta = _next;
UUID changeId = getChangeId(_next);
if (_list == null) {
_list = Lists.newArrayListWithCapacity(numBlocks);
}
_list.add(_next);
for (int... | java | private BlockedDelta compute(int numBlocks) {
int contentSize = getValue(_next).remaining();
_oldDelta = _next;
UUID changeId = getChangeId(_next);
if (_list == null) {
_list = Lists.newArrayListWithCapacity(numBlocks);
}
_list.add(_next);
for (int... | [
"private",
"BlockedDelta",
"compute",
"(",
"int",
"numBlocks",
")",
"{",
"int",
"contentSize",
"=",
"getValue",
"(",
"_next",
")",
".",
"remaining",
"(",
")",
";",
"_oldDelta",
"=",
"_next",
";",
"UUID",
"changeId",
"=",
"getChangeId",
"(",
"_next",
")",
... | stitch delta together and return it as one bytebuffer | [
"stitch",
"delta",
"together",
"and",
"return",
"it",
"as",
"one",
"bytebuffer"
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/DeltaIterator.java#L80-L115 |
108,492 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/DeltaIterator.java | DeltaIterator.skipForward | private int skipForward() {
int numSkips = 0;
_next = null;
while (_iterator.hasNext() && getBlock(_next = _iterator.next()) != 0) {
numSkips++;
_next = null;
}
return numSkips;
} | java | private int skipForward() {
int numSkips = 0;
_next = null;
while (_iterator.hasNext() && getBlock(_next = _iterator.next()) != 0) {
numSkips++;
_next = null;
}
return numSkips;
} | [
"private",
"int",
"skipForward",
"(",
")",
"{",
"int",
"numSkips",
"=",
"0",
";",
"_next",
"=",
"null",
";",
"while",
"(",
"_iterator",
".",
"hasNext",
"(",
")",
"&&",
"getBlock",
"(",
"_next",
"=",
"_iterator",
".",
"next",
"(",
")",
")",
"!=",
"0... | This handles the edge case in which a client has explicity specified a changeId when writing and overwrote an exisiting delta. | [
"This",
"handles",
"the",
"edge",
"case",
"in",
"which",
"a",
"client",
"has",
"explicity",
"specified",
"a",
"changeId",
"when",
"writing",
"and",
"overwrote",
"an",
"exisiting",
"delta",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/DeltaIterator.java#L177-L185 |
108,493 | bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/DeltaIterator.java | DeltaIterator.getNumBlocks | private int getNumBlocks(R delta) {
ByteBuffer content = getValue(delta);
int numBlocks = 0;
// build numBlocks by adding together each hex digit
for (int i = 0; i < _prefixLength; i++) {
byte b = content.get(i);
numBlocks = numBlocks << 4 | (b <= '9' ? b - '0' :... | java | private int getNumBlocks(R delta) {
ByteBuffer content = getValue(delta);
int numBlocks = 0;
// build numBlocks by adding together each hex digit
for (int i = 0; i < _prefixLength; i++) {
byte b = content.get(i);
numBlocks = numBlocks << 4 | (b <= '9' ? b - '0' :... | [
"private",
"int",
"getNumBlocks",
"(",
"R",
"delta",
")",
"{",
"ByteBuffer",
"content",
"=",
"getValue",
"(",
"delta",
")",
";",
"int",
"numBlocks",
"=",
"0",
";",
"// build numBlocks by adding together each hex digit",
"for",
"(",
"int",
"i",
"=",
"0",
";",
... | converts utf-8 encoded hex to int by building it digit by digit. | [
"converts",
"utf",
"-",
"8",
"encoded",
"hex",
"to",
"int",
"by",
"building",
"it",
"digit",
"by",
"digit",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/DeltaIterator.java#L188-L199 |
108,494 | bazaarvoice/emodb | databus/src/main/java/com/bazaarvoice/emodb/databus/repl/DefaultReplicationManager.java | DefaultReplicationManager.newRemoteReplicationSource | private ReplicationSource newRemoteReplicationSource(DataCenter dataCenter) {
MultiThreadedServiceFactory<ReplicationSource> clientFactory = new ReplicationClientFactory(_jerseyClient)
.usingApiKey(_replicationApiKey);
ServiceEndPoint endPoint = new ServiceEndPointBuilder()
... | java | private ReplicationSource newRemoteReplicationSource(DataCenter dataCenter) {
MultiThreadedServiceFactory<ReplicationSource> clientFactory = new ReplicationClientFactory(_jerseyClient)
.usingApiKey(_replicationApiKey);
ServiceEndPoint endPoint = new ServiceEndPointBuilder()
... | [
"private",
"ReplicationSource",
"newRemoteReplicationSource",
"(",
"DataCenter",
"dataCenter",
")",
"{",
"MultiThreadedServiceFactory",
"<",
"ReplicationSource",
">",
"clientFactory",
"=",
"new",
"ReplicationClientFactory",
"(",
"_jerseyClient",
")",
".",
"usingApiKey",
"("... | Creates a ReplicationSource proxy to the remote data center. | [
"Creates",
"a",
"ReplicationSource",
"proxy",
"to",
"the",
"remote",
"data",
"center",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/databus/src/main/java/com/bazaarvoice/emodb/databus/repl/DefaultReplicationManager.java#L184-L204 |
108,495 | bazaarvoice/emodb | common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/CqlCluster.java | CqlCluster.registerMetrics | private void registerMetrics() {
if (_metricName == null) {
// No metric name was provided; skip registration
return;
}
Metrics metrics = _cluster.getMetrics();
_metricRegistry.register(
MetricRegistry.name("bv.emodb.cql", _metricName, "Connectio... | java | private void registerMetrics() {
if (_metricName == null) {
// No metric name was provided; skip registration
return;
}
Metrics metrics = _cluster.getMetrics();
_metricRegistry.register(
MetricRegistry.name("bv.emodb.cql", _metricName, "Connectio... | [
"private",
"void",
"registerMetrics",
"(",
")",
"{",
"if",
"(",
"_metricName",
"==",
"null",
")",
"{",
"// No metric name was provided; skip registration",
"return",
";",
"}",
"Metrics",
"metrics",
"=",
"_cluster",
".",
"getMetrics",
"(",
")",
";",
"_metricRegistr... | Registers metrics for this cluster. Ideally this would be done before the cluster is started so conflicting
metric names could be detected earlier, but since the CQL driver doesn't publish metrics until after it is
initialized the metrics cannot be registered until then. | [
"Registers",
"metrics",
"for",
"this",
"cluster",
".",
"Ideally",
"this",
"would",
"be",
"done",
"before",
"the",
"cluster",
"is",
"started",
"so",
"conflicting",
"metric",
"names",
"could",
"be",
"detected",
"earlier",
"but",
"since",
"the",
"CQL",
"driver",
... | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/astyanax/src/main/java/com/bazaarvoice/emodb/common/cassandra/CqlCluster.java#L49-L112 |
108,496 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java | FileSystemUtil.getRootFileStatus | public static FileStatus getRootFileStatus(Path rootPath) {
return new FileStatus(0, true, 1, 1024, -1, -1, DIRECTORY_PERMISSION, null, null, rootPath);
} | java | public static FileStatus getRootFileStatus(Path rootPath) {
return new FileStatus(0, true, 1, 1024, -1, -1, DIRECTORY_PERMISSION, null, null, rootPath);
} | [
"public",
"static",
"FileStatus",
"getRootFileStatus",
"(",
"Path",
"rootPath",
")",
"{",
"return",
"new",
"FileStatus",
"(",
"0",
",",
"true",
",",
"1",
",",
"1024",
",",
"-",
"1",
",",
"-",
"1",
",",
"DIRECTORY_PERMISSION",
",",
"null",
",",
"null",
... | Returns a FileStatus for the given root path. | [
"Returns",
"a",
"FileStatus",
"for",
"the",
"given",
"root",
"path",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java#L40-L42 |
108,497 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java | FileSystemUtil.getTableFileStatus | public static FileStatus getTableFileStatus(Path rootPath, String table) {
return new FileStatus(0, true, 1, 1024, -1, -1, DIRECTORY_PERMISSION, null, null,
getTablePath(rootPath, table));
} | java | public static FileStatus getTableFileStatus(Path rootPath, String table) {
return new FileStatus(0, true, 1, 1024, -1, -1, DIRECTORY_PERMISSION, null, null,
getTablePath(rootPath, table));
} | [
"public",
"static",
"FileStatus",
"getTableFileStatus",
"(",
"Path",
"rootPath",
",",
"String",
"table",
")",
"{",
"return",
"new",
"FileStatus",
"(",
"0",
",",
"true",
",",
"1",
",",
"1024",
",",
"-",
"1",
",",
"-",
"1",
",",
"DIRECTORY_PERMISSION",
","... | Returns a FileStatus for a table. | [
"Returns",
"a",
"FileStatus",
"for",
"a",
"table",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java#L47-L50 |
108,498 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java | FileSystemUtil.getSplitFileStatus | public static FileStatus getSplitFileStatus(Path rootPath, String table, String split, long size, int blockSize) {
return new FileStatus(size, false, 1, blockSize, -1, -1, FILE_PERMISSION, null, null,
getSplitPath(rootPath, table, split));
} | java | public static FileStatus getSplitFileStatus(Path rootPath, String table, String split, long size, int blockSize) {
return new FileStatus(size, false, 1, blockSize, -1, -1, FILE_PERMISSION, null, null,
getSplitPath(rootPath, table, split));
} | [
"public",
"static",
"FileStatus",
"getSplitFileStatus",
"(",
"Path",
"rootPath",
",",
"String",
"table",
",",
"String",
"split",
",",
"long",
"size",
",",
"int",
"blockSize",
")",
"{",
"return",
"new",
"FileStatus",
"(",
"size",
",",
"false",
",",
"1",
","... | Returns a FileStatus for a split. | [
"Returns",
"a",
"FileStatus",
"for",
"a",
"split",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java#L55-L58 |
108,499 | bazaarvoice/emodb | mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java | FileSystemUtil.getTableName | @Nullable
public static String getTableName(Path rootPath, Path path) {
path = qualified(rootPath, path);
if (rootPath.equals(path)) {
// Path is root, no table
return null;
}
Path tablePath;
Path parent = path.getParent();
if (Objects.equals(... | java | @Nullable
public static String getTableName(Path rootPath, Path path) {
path = qualified(rootPath, path);
if (rootPath.equals(path)) {
// Path is root, no table
return null;
}
Path tablePath;
Path parent = path.getParent();
if (Objects.equals(... | [
"@",
"Nullable",
"public",
"static",
"String",
"getTableName",
"(",
"Path",
"rootPath",
",",
"Path",
"path",
")",
"{",
"path",
"=",
"qualified",
"(",
"rootPath",
",",
"path",
")",
";",
"if",
"(",
"rootPath",
".",
"equals",
"(",
"path",
")",
")",
"{",
... | Gets the table name from a path, or null if the path is the root path. | [
"Gets",
"the",
"table",
"name",
"from",
"a",
"path",
"or",
"null",
"if",
"the",
"path",
"is",
"the",
"root",
"path",
"."
] | 97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/mapreduce/sor-hadoop/src/main/java/com/bazaarvoice/emodb/hadoop/io/FileSystemUtil.java#L63-L84 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.