repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
apache/incubator-atlas | notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java | FailedMessagesLogger.getRootLoggerDirectory | private String getRootLoggerDirectory() {
String rootLoggerDirectory = null;
org.apache.log4j.Logger rootLogger = org.apache.log4j.Logger.getRootLogger();
Enumeration allAppenders = rootLogger.getAllAppenders();
if (allAppenders != null) {
while (allAppenders.hasMoreElements... | java | private String getRootLoggerDirectory() {
String rootLoggerDirectory = null;
org.apache.log4j.Logger rootLogger = org.apache.log4j.Logger.getRootLogger();
Enumeration allAppenders = rootLogger.getAllAppenders();
if (allAppenders != null) {
while (allAppenders.hasMoreElements... | [
"private",
"String",
"getRootLoggerDirectory",
"(",
")",
"{",
"String",
"rootLoggerDirectory",
"=",
"null",
";",
"org",
".",
"apache",
".",
"log4j",
".",
"Logger",
"rootLogger",
"=",
"org",
".",
"apache",
".",
"log4j",
".",
"Logger",
".",
"getRootLogger",
"(... | Get the root logger file location under which the failed log messages will be written.
Since this class is used in Hooks which run within JVMs of other components like Hive,
we want to write the failed messages file under the same location as where logs from
the host component are saved. This method attempts to get su... | [
"Get",
"the",
"root",
"logger",
"file",
"location",
"under",
"which",
"the",
"failed",
"log",
"messages",
"will",
"be",
"written",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/notification/src/main/java/org/apache/atlas/hook/FailedMessagesLogger.java#L75-L92 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/memory/HierarchicalTypeStore.java | HierarchicalTypeStore.assignPosition | int assignPosition(Id id) throws RepositoryException {
int pos = -1;
if (!freePositions.isEmpty()) {
pos = freePositions.remove(0);
} else {
pos = nextPos++;
ensureCapacity(pos);
}
idPosMap.put(id, pos);
for (HierarchicalTypeStore s ... | java | int assignPosition(Id id) throws RepositoryException {
int pos = -1;
if (!freePositions.isEmpty()) {
pos = freePositions.remove(0);
} else {
pos = nextPos++;
ensureCapacity(pos);
}
idPosMap.put(id, pos);
for (HierarchicalTypeStore s ... | [
"int",
"assignPosition",
"(",
"Id",
"id",
")",
"throws",
"RepositoryException",
"{",
"int",
"pos",
"=",
"-",
"1",
";",
"if",
"(",
"!",
"freePositions",
".",
"isEmpty",
"(",
")",
")",
"{",
"pos",
"=",
"freePositions",
".",
"remove",
"(",
"0",
")",
";"... | Assign a storage position to an Id.
- try to assign from freePositions
- ensure storage capacity.
- add entry in idPosMap.
@param id
@return
@throws RepositoryException | [
"Assign",
"a",
"storage",
"position",
"to",
"an",
"Id",
".",
"-",
"try",
"to",
"assign",
"from",
"freePositions",
"-",
"ensure",
"storage",
"capacity",
".",
"-",
"add",
"entry",
"in",
"idPosMap",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/memory/HierarchicalTypeStore.java#L99-L116 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/memory/HierarchicalTypeStore.java | HierarchicalTypeStore.releaseId | void releaseId(Id id) {
Integer pos = idPosMap.get(id);
if (pos != null) {
idPosMap.remove(id);
freePositions.add(pos);
for (HierarchicalTypeStore s : superTypeStores) {
s.releaseId(id);
}
}
} | java | void releaseId(Id id) {
Integer pos = idPosMap.get(id);
if (pos != null) {
idPosMap.remove(id);
freePositions.add(pos);
for (HierarchicalTypeStore s : superTypeStores) {
s.releaseId(id);
}
}
} | [
"void",
"releaseId",
"(",
"Id",
"id",
")",
"{",
"Integer",
"pos",
"=",
"idPosMap",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"pos",
"!=",
"null",
")",
"{",
"idPosMap",
".",
"remove",
"(",
"id",
")",
";",
"freePositions",
".",
"add",
"(",
"pos",... | - remove from idPosMap
- add to freePositions.
@throws RepositoryException | [
"-",
"remove",
"from",
"idPosMap",
"-",
"add",
"to",
"freePositions",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/memory/HierarchicalTypeStore.java#L123-L134 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/memory/HierarchicalTypeStore.java | HierarchicalTypeStore.store | void store(ReferenceableInstance i) throws RepositoryException {
int pos = idPosMap.get(i.getId());
typeNameList.set(pos, i.getTypeName());
storeFields(pos, i);
for (HierarchicalTypeStore s : superTypeStores) {
s.store(i);
}
} | java | void store(ReferenceableInstance i) throws RepositoryException {
int pos = idPosMap.get(i.getId());
typeNameList.set(pos, i.getTypeName());
storeFields(pos, i);
for (HierarchicalTypeStore s : superTypeStores) {
s.store(i);
}
} | [
"void",
"store",
"(",
"ReferenceableInstance",
"i",
")",
"throws",
"RepositoryException",
"{",
"int",
"pos",
"=",
"idPosMap",
".",
"get",
"(",
"i",
".",
"getId",
"(",
")",
")",
";",
"typeNameList",
".",
"set",
"(",
"pos",
",",
"i",
".",
"getTypeName",
... | - store the typeName
- store the immediate attributes in the respective IAttributeStore
- call store on each SuperType.
@param i
@throws RepositoryException | [
"-",
"store",
"the",
"typeName",
"-",
"store",
"the",
"immediate",
"attributes",
"in",
"the",
"respective",
"IAttributeStore",
"-",
"call",
"store",
"on",
"each",
"SuperType",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/memory/HierarchicalTypeStore.java#L173-L181 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/memory/HierarchicalTypeStore.java | HierarchicalTypeStore.load | void load(ReferenceableInstance i) throws RepositoryException {
int pos = idPosMap.get(i.getId());
loadFields(pos, i);
for (HierarchicalTypeStore s : superTypeStores) {
s.load(i);
}
} | java | void load(ReferenceableInstance i) throws RepositoryException {
int pos = idPosMap.get(i.getId());
loadFields(pos, i);
for (HierarchicalTypeStore s : superTypeStores) {
s.load(i);
}
} | [
"void",
"load",
"(",
"ReferenceableInstance",
"i",
")",
"throws",
"RepositoryException",
"{",
"int",
"pos",
"=",
"idPosMap",
".",
"get",
"(",
"i",
".",
"getId",
"(",
")",
")",
";",
"loadFields",
"(",
"pos",
",",
"i",
")",
";",
"for",
"(",
"Hierarchical... | - copy over the immediate attribute values from the respective IAttributeStore
- call load on each SuperType.
@param i
@throws RepositoryException | [
"-",
"copy",
"over",
"the",
"immediate",
"attribute",
"values",
"from",
"the",
"respective",
"IAttributeStore",
"-",
"call",
"load",
"on",
"each",
"SuperType",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/memory/HierarchicalTypeStore.java#L189-L196 | train |
apache/incubator-atlas | notification/src/main/java/org/apache/atlas/notification/AbstractNotification.java | AbstractNotification.getMessageJson | public static String getMessageJson(Object message) {
VersionedMessage<?> versionedMessage = new VersionedMessage<>(CURRENT_MESSAGE_VERSION, message);
return GSON.toJson(versionedMessage);
} | java | public static String getMessageJson(Object message) {
VersionedMessage<?> versionedMessage = new VersionedMessage<>(CURRENT_MESSAGE_VERSION, message);
return GSON.toJson(versionedMessage);
} | [
"public",
"static",
"String",
"getMessageJson",
"(",
"Object",
"message",
")",
"{",
"VersionedMessage",
"<",
"?",
">",
"versionedMessage",
"=",
"new",
"VersionedMessage",
"<>",
"(",
"CURRENT_MESSAGE_VERSION",
",",
"message",
")",
";",
"return",
"GSON",
".",
"toJ... | Get the notification message JSON from the given object.
@param message the message in object form
@return the message as a JSON string | [
"Get",
"the",
"notification",
"message",
"JSON",
"from",
"the",
"given",
"object",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/notification/src/main/java/org/apache/atlas/notification/AbstractNotification.java#L132-L136 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/audit/InMemoryEntityAuditRepository.java | InMemoryEntityAuditRepository.listEvents | @Override
public synchronized List<EntityAuditEvent> listEvents(String entityId, String startKey, short maxResults)
throws AtlasException {
List<EntityAuditEvent> events = new ArrayList<>();
String myStartKey = startKey;
if (myStartKey == null) {
myStartKey = entityId... | java | @Override
public synchronized List<EntityAuditEvent> listEvents(String entityId, String startKey, short maxResults)
throws AtlasException {
List<EntityAuditEvent> events = new ArrayList<>();
String myStartKey = startKey;
if (myStartKey == null) {
myStartKey = entityId... | [
"@",
"Override",
"public",
"synchronized",
"List",
"<",
"EntityAuditEvent",
">",
"listEvents",
"(",
"String",
"entityId",
",",
"String",
"startKey",
",",
"short",
"maxResults",
")",
"throws",
"AtlasException",
"{",
"List",
"<",
"EntityAuditEvent",
">",
"events",
... | while we are iterating through the map | [
"while",
"we",
"are",
"iterating",
"through",
"the",
"map"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/audit/InMemoryEntityAuditRepository.java#L58-L73 | train |
apache/incubator-atlas | typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeUtils.java | TypeUtils.validateUpdate | public static void validateUpdate(FieldMapping oldFieldMapping, FieldMapping newFieldMapping)
throws TypeUpdateException {
Map<String, AttributeInfo> newFields = newFieldMapping.fields;
for (AttributeInfo attribute : oldFieldMapping.fields.values()) {
if (newFields.containsKey(at... | java | public static void validateUpdate(FieldMapping oldFieldMapping, FieldMapping newFieldMapping)
throws TypeUpdateException {
Map<String, AttributeInfo> newFields = newFieldMapping.fields;
for (AttributeInfo attribute : oldFieldMapping.fields.values()) {
if (newFields.containsKey(at... | [
"public",
"static",
"void",
"validateUpdate",
"(",
"FieldMapping",
"oldFieldMapping",
",",
"FieldMapping",
"newFieldMapping",
")",
"throws",
"TypeUpdateException",
"{",
"Map",
"<",
"String",
",",
"AttributeInfo",
">",
"newFields",
"=",
"newFieldMapping",
".",
"fields"... | Validates that the old field mapping can be replaced with new field mapping
@param oldFieldMapping
@param newFieldMapping | [
"Validates",
"that",
"the",
"old",
"field",
"mapping",
"can",
"be",
"replaced",
"with",
"new",
"field",
"mapping"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeUtils.java#L103-L135 | train |
apache/incubator-atlas | graphdb/titan1/src/main/java/org/apache/atlas/repository/graphdb/titan1/TitanObjectFactory.java | TitanObjectFactory.createDirection | public static Direction createDirection(AtlasEdgeDirection dir) {
switch(dir) {
case IN:
return Direction.IN;
case OUT:
return Direction.OUT;
case BOTH:
return Direction.BOTH;
default:
throw new RuntimeException("Unrecognized direc... | java | public static Direction createDirection(AtlasEdgeDirection dir) {
switch(dir) {
case IN:
return Direction.IN;
case OUT:
return Direction.OUT;
case BOTH:
return Direction.BOTH;
default:
throw new RuntimeException("Unrecognized direc... | [
"public",
"static",
"Direction",
"createDirection",
"(",
"AtlasEdgeDirection",
"dir",
")",
"{",
"switch",
"(",
"dir",
")",
"{",
"case",
"IN",
":",
"return",
"Direction",
".",
"IN",
";",
"case",
"OUT",
":",
"return",
"Direction",
".",
"OUT",
";",
"case",
... | Retrieves the titan direction corresponding to the given
AtlasEdgeDirection.
@param dir
@return | [
"Retrieves",
"the",
"titan",
"direction",
"corresponding",
"to",
"the",
"given",
"AtlasEdgeDirection",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/graphdb/titan1/src/main/java/org/apache/atlas/repository/graphdb/titan1/TitanObjectFactory.java#L46-L58 | train |
apache/incubator-atlas | typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java | TypeSystem.defineQueryResultType | public StructType defineQueryResultType(String name, Map<String, IDataType> tempTypes,
AttributeDefinition... attrDefs) throws AtlasException {
AttributeInfo[] infos = new AttributeInfo[attrDefs.length];
for (int i = 0; i < attrDefs.length; i++) {
infos[i] = new AttributeInfo(th... | java | public StructType defineQueryResultType(String name, Map<String, IDataType> tempTypes,
AttributeDefinition... attrDefs) throws AtlasException {
AttributeInfo[] infos = new AttributeInfo[attrDefs.length];
for (int i = 0; i < attrDefs.length; i++) {
infos[i] = new AttributeInfo(th... | [
"public",
"StructType",
"defineQueryResultType",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"IDataType",
">",
"tempTypes",
",",
"AttributeDefinition",
"...",
"attrDefs",
")",
"throws",
"AtlasException",
"{",
"AttributeInfo",
"[",
"]",
"infos",
"=",
"... | construct a temporary StructType for a Query Result. This is not registered in the
typeSystem.
The attributes in the typeDefinition can only reference permanent types.
@param name struct type name
@param attrDefs struct type definition
@return temporary struct type
@throws AtlasException | [
"construct",
"a",
"temporary",
"StructType",
"for",
"a",
"Query",
"Result",
".",
"This",
"is",
"not",
"registered",
"in",
"the",
"typeSystem",
".",
"The",
"attributes",
"in",
"the",
"typeDefinition",
"can",
"only",
"reference",
"permanent",
"types",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/typesystem/src/main/java/org/apache/atlas/typesystem/types/TypeSystem.java#L223-L232 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/resources/MetadataDiscoveryResource.java | MetadataDiscoveryResource.search | @GET
@Path("search")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response search(@QueryParam("query") String query,
@DefaultValue(LIMIT_OFFSET_DEFAULT) @QueryParam("limit") int limit,
@DefaultValue(LIMIT_OFFSET_DEFA... | java | @GET
@Path("search")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response search(@QueryParam("query") String query,
@DefaultValue(LIMIT_OFFSET_DEFAULT) @QueryParam("limit") int limit,
@DefaultValue(LIMIT_OFFSET_DEFA... | [
"@",
"GET",
"@",
"Path",
"(",
"\"search\"",
")",
"@",
"Consumes",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"Response",
"search",
"(",
"@",
"QueryParam",
"(",
"\"query\"",
")",
"S... | Search using a given query.
@param query search query in DSL format falling back to full text.
@param limit number of rows to be returned in the result, used for pagination. maxlimit > limit > 0. -1 maps to atlas.search.defaultlimit property value
@param offset offset to the results returned, used for pagination. offs... | [
"Search",
"using",
"a",
"given",
"query",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/resources/MetadataDiscoveryResource.java#L88-L115 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/resources/MetadataDiscoveryResource.java | MetadataDiscoveryResource.searchUsingQueryDSL | @GET
@Path("search/dsl")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response searchUsingQueryDSL(@QueryParam("query") String dslQuery,
@DefaultValue(LIMIT_OFFSET_DEFAULT) @QueryParam("limit") int limit,
... | java | @GET
@Path("search/dsl")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response searchUsingQueryDSL(@QueryParam("query") String dslQuery,
@DefaultValue(LIMIT_OFFSET_DEFAULT) @QueryParam("limit") int limit,
... | [
"@",
"GET",
"@",
"Path",
"(",
"\"search/dsl\"",
")",
"@",
"Consumes",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"Response",
"searchUsingQueryDSL",
"(",
"@",
"QueryParam",
"(",
"\"quer... | Search using query DSL format.
@param dslQuery search query in DSL format.
@param limit number of rows to be returned in the result, used for pagination. maxlimit > limit > 0. -1 maps to atlas.search.defaultlimit property value
@param offset offset to the results returned, used for pagination. offset >= 0. -1 maps to ... | [
"Search",
"using",
"query",
"DSL",
"format",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/resources/MetadataDiscoveryResource.java#L129-L169 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/resources/MetadataDiscoveryResource.java | MetadataDiscoveryResource.searchUsingGremlinQuery | @GET
@Path("search/gremlin")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
@InterfaceAudience.Private
public Response searchUsingGremlinQuery(@QueryParam("query") String gremlinQuery) {
if (LOG.isDebugEnabled()) {
LOG.debug("==> MetadataDiscoveryResource... | java | @GET
@Path("search/gremlin")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
@InterfaceAudience.Private
public Response searchUsingGremlinQuery(@QueryParam("query") String gremlinQuery) {
if (LOG.isDebugEnabled()) {
LOG.debug("==> MetadataDiscoveryResource... | [
"@",
"GET",
"@",
"Path",
"(",
"\"search/gremlin\"",
")",
"@",
"Consumes",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"@",
"InterfaceAudience",
".",
"Private",
"public",
"Response",
"searchUsingGre... | Search using raw gremlin query format.
@param gremlinQuery search query in raw gremlin format.
@return JSON representing the type and results. | [
"Search",
"using",
"raw",
"gremlin",
"query",
"format",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/resources/MetadataDiscoveryResource.java#L199-L247 | train |
apache/incubator-atlas | graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/titan/query/expr/AndCondition.java | AndCondition.copy | public AndCondition copy() {
AndCondition builder = new AndCondition();
builder.children.addAll(children);
return builder;
} | java | public AndCondition copy() {
AndCondition builder = new AndCondition();
builder.children.addAll(children);
return builder;
} | [
"public",
"AndCondition",
"copy",
"(",
")",
"{",
"AndCondition",
"builder",
"=",
"new",
"AndCondition",
"(",
")",
";",
"builder",
".",
"children",
".",
"addAll",
"(",
"children",
")",
";",
"return",
"builder",
";",
"}"
] | Makes a copy of this AndExpr.
@return | [
"Makes",
"a",
"copy",
"of",
"this",
"AndExpr",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/titan/query/expr/AndCondition.java#L63-L67 | train |
apache/incubator-atlas | graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/titan/query/expr/AndCondition.java | AndCondition.create | public <V, E> NativeTitanGraphQuery<V, E> create(NativeTitanQueryFactory<V, E> factory) {
NativeTitanGraphQuery<V, E> query = factory.createNativeTitanQuery();
for (QueryPredicate predicate : children) {
predicate.addTo(query);
}
return query;
} | java | public <V, E> NativeTitanGraphQuery<V, E> create(NativeTitanQueryFactory<V, E> factory) {
NativeTitanGraphQuery<V, E> query = factory.createNativeTitanQuery();
for (QueryPredicate predicate : children) {
predicate.addTo(query);
}
return query;
} | [
"public",
"<",
"V",
",",
"E",
">",
"NativeTitanGraphQuery",
"<",
"V",
",",
"E",
">",
"create",
"(",
"NativeTitanQueryFactory",
"<",
"V",
",",
"E",
">",
"factory",
")",
"{",
"NativeTitanGraphQuery",
"<",
"V",
",",
"E",
">",
"query",
"=",
"factory",
".",... | Creates a NativeTitanGraphQuery that can be used to evaluate this condition.
@param factory
@return | [
"Creates",
"a",
"NativeTitanGraphQuery",
"that",
"can",
"be",
"used",
"to",
"evaluate",
"this",
"condition",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/titan/query/expr/AndCondition.java#L84-L90 | train |
apache/incubator-atlas | server-api/src/main/java/org/apache/atlas/RequestContext.java | RequestContext.cache | public void cache(AtlasEntityWithExtInfo entity) {
if (entity != null && entity.getEntity() != null && entity.getEntity().getGuid() != null) {
entityCacheV2.put(entity.getEntity().getGuid(), entity);
}
} | java | public void cache(AtlasEntityWithExtInfo entity) {
if (entity != null && entity.getEntity() != null && entity.getEntity().getGuid() != null) {
entityCacheV2.put(entity.getEntity().getGuid(), entity);
}
} | [
"public",
"void",
"cache",
"(",
"AtlasEntityWithExtInfo",
"entity",
")",
"{",
"if",
"(",
"entity",
"!=",
"null",
"&&",
"entity",
".",
"getEntity",
"(",
")",
"!=",
"null",
"&&",
"entity",
".",
"getEntity",
"(",
")",
".",
"getGuid",
"(",
")",
"!=",
"null... | Adds the specified instance to the cache | [
"Adds",
"the",
"specified",
"instance",
"to",
"the",
"cache"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/server-api/src/main/java/org/apache/atlas/RequestContext.java#L96-L100 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/discovery/graph/GraphBackedDiscoveryService.java | GraphBackedDiscoveryService.searchByGremlin | @Override
@GraphTransaction
public List<Map<String, String>> searchByGremlin(String gremlinQuery) throws DiscoveryException {
LOG.debug("Executing gremlin query={}", gremlinQuery);
try {
Object o = graph.executeGremlinScript(gremlinQuery, false);
return extractResult(o);
... | java | @Override
@GraphTransaction
public List<Map<String, String>> searchByGremlin(String gremlinQuery) throws DiscoveryException {
LOG.debug("Executing gremlin query={}", gremlinQuery);
try {
Object o = graph.executeGremlinScript(gremlinQuery, false);
return extractResult(o);
... | [
"@",
"Override",
"@",
"GraphTransaction",
"public",
"List",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"searchByGremlin",
"(",
"String",
"gremlinQuery",
")",
"throws",
"DiscoveryException",
"{",
"LOG",
".",
"debug",
"(",
"\"Executing gremlin query={}\"",
... | Assumes the User is familiar with the persistence structure of the Repository.
The given query is run uninterpreted against the underlying Graph Store.
The results are returned as a List of Rows. each row is a Map of Key,Value pairs.
@param gremlinQuery query in gremlin dsl format
@return List of Maps
@throws org.apac... | [
"Assumes",
"the",
"User",
"is",
"familiar",
"with",
"the",
"persistence",
"structure",
"of",
"the",
"Repository",
".",
"The",
"given",
"query",
"is",
"run",
"uninterpreted",
"against",
"the",
"underlying",
"Graph",
"Store",
".",
"The",
"results",
"are",
"retur... | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/discovery/graph/GraphBackedDiscoveryService.java#L208-L218 | train |
apache/incubator-atlas | graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0GraphDatabase.java | Titan0GraphDatabase.addSolr5Index | private static void addSolr5Index() {
try {
Field field = StandardIndexProvider.class.getDeclaredField("ALL_MANAGER_CLASSES");
field.setAccessible(true);
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
... | java | private static void addSolr5Index() {
try {
Field field = StandardIndexProvider.class.getDeclaredField("ALL_MANAGER_CLASSES");
field.setAccessible(true);
Field modifiersField = Field.class.getDeclaredField("modifiers");
modifiersField.setAccessible(true);
... | [
"private",
"static",
"void",
"addSolr5Index",
"(",
")",
"{",
"try",
"{",
"Field",
"field",
"=",
"StandardIndexProvider",
".",
"class",
".",
"getDeclaredField",
"(",
"\"ALL_MANAGER_CLASSES\"",
")",
";",
"field",
".",
"setAccessible",
"(",
"true",
")",
";",
"Fie... | Titan loads index backend name to implementation using
StandardIndexProvider.ALL_MANAGER_CLASSES But
StandardIndexProvider.ALL_MANAGER_CLASSES is a private static final
ImmutableMap Only way to inject Solr5Index is to modify this field. So,
using hacky reflection to add Sol5Index | [
"Titan",
"loads",
"index",
"backend",
"name",
"to",
"implementation",
"using",
"StandardIndexProvider",
".",
"ALL_MANAGER_CLASSES",
"But",
"StandardIndexProvider",
".",
"ALL_MANAGER_CLASSES",
"is",
"a",
"private",
"static",
"final",
"ImmutableMap",
"Only",
"way",
"to",
... | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/graphdb/titan0/src/main/java/org/apache/atlas/repository/graphdb/titan0/Titan0GraphDatabase.java#L79-L102 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/service/SecureEmbeddedServer.java | SecureEmbeddedServer.getPassword | private String getPassword(org.apache.commons.configuration.Configuration config, String key) throws IOException {
String password;
String provider = config.getString(CERT_STORES_CREDENTIAL_PROVIDER_PATH);
if (provider != null) {
LOG.info("Attempting to retrieve password from confi... | java | private String getPassword(org.apache.commons.configuration.Configuration config, String key) throws IOException {
String password;
String provider = config.getString(CERT_STORES_CREDENTIAL_PROVIDER_PATH);
if (provider != null) {
LOG.info("Attempting to retrieve password from confi... | [
"private",
"String",
"getPassword",
"(",
"org",
".",
"apache",
".",
"commons",
".",
"configuration",
".",
"Configuration",
"config",
",",
"String",
"key",
")",
"throws",
"IOException",
"{",
"String",
"password",
";",
"String",
"provider",
"=",
"config",
".",
... | Retrieves a password from a configured credential provider or prompts for the password and stores it in the
configured credential provider.
@param config application configuration
@param key the key/alias for the password.
@return the password.
@throws IOException | [
"Retrieves",
"a",
"password",
"from",
"a",
"configured",
"credential",
"provider",
"or",
"prompts",
"for",
"the",
"password",
"and",
"stores",
"it",
"in",
"the",
"configured",
"credential",
"provider",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/service/SecureEmbeddedServer.java#L122-L145 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/service/SecureEmbeddedServer.java | SecureEmbeddedServer.getConfiguration | protected org.apache.commons.configuration.Configuration getConfiguration() {
try {
return ApplicationProperties.get();
} catch (AtlasException e) {
throw new RuntimeException("Unable to load configuration: " + ApplicationProperties.APPLICATION_PROPERTIES);
}
} | java | protected org.apache.commons.configuration.Configuration getConfiguration() {
try {
return ApplicationProperties.get();
} catch (AtlasException e) {
throw new RuntimeException("Unable to load configuration: " + ApplicationProperties.APPLICATION_PROPERTIES);
}
} | [
"protected",
"org",
".",
"apache",
".",
"commons",
".",
"configuration",
".",
"Configuration",
"getConfiguration",
"(",
")",
"{",
"try",
"{",
"return",
"ApplicationProperties",
".",
"get",
"(",
")",
";",
"}",
"catch",
"(",
"AtlasException",
"e",
")",
"{",
... | Returns the application configuration.
@return | [
"Returns",
"the",
"application",
"configuration",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/service/SecureEmbeddedServer.java#L151-L157 | train |
apache/incubator-atlas | graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/titan/query/expr/OrCondition.java | OrCondition.andWith | public void andWith(OrCondition other) {
//Because Titan does not natively support Or conditions in Graph Queries,
//we need to expand out the condition so it is in the form of a single OrCondition
//that contains only AndConditions. We do this by following the rules of boolean
//algeb... | java | public void andWith(OrCondition other) {
//Because Titan does not natively support Or conditions in Graph Queries,
//we need to expand out the condition so it is in the form of a single OrCondition
//that contains only AndConditions. We do this by following the rules of boolean
//algeb... | [
"public",
"void",
"andWith",
"(",
"OrCondition",
"other",
")",
"{",
"//Because Titan does not natively support Or conditions in Graph Queries,",
"//we need to expand out the condition so it is in the form of a single OrCondition",
"//that contains only AndConditions. We do this by following the... | Updates this OrCondition in place so that it matches vertices that satisfy the current
OrCondition AND that satisfy the provided OrCondition.
@param other | [
"Updates",
"this",
"OrCondition",
"in",
"place",
"so",
"that",
"it",
"matches",
"vertices",
"that",
"satisfy",
"the",
"current",
"OrCondition",
"AND",
"that",
"satisfy",
"the",
"provided",
"OrCondition",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/graphdb/common/src/main/java/org/apache/atlas/repository/graphdb/titan/query/expr/OrCondition.java#L76-L108 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/util/DateTimeHelper.java | DateTimeHelper.validate | public static boolean validate(final String date) {
Matcher matcher = PATTERN.matcher(date);
if (matcher.matches()) {
matcher.reset();
if (matcher.find()) {
int year = Integer.parseInt(matcher.group(1));
String month = matcher.group(2);
... | java | public static boolean validate(final String date) {
Matcher matcher = PATTERN.matcher(date);
if (matcher.matches()) {
matcher.reset();
if (matcher.find()) {
int year = Integer.parseInt(matcher.group(1));
String month = matcher.group(2);
... | [
"public",
"static",
"boolean",
"validate",
"(",
"final",
"String",
"date",
")",
"{",
"Matcher",
"matcher",
"=",
"PATTERN",
".",
"matcher",
"(",
"date",
")",
";",
"if",
"(",
"matcher",
".",
"matches",
"(",
")",
")",
"{",
"matcher",
".",
"reset",
"(",
... | Validate date format with regular expression.
@param date date address for validation
@return true valid date fromat, false invalid date format | [
"Validate",
"date",
"format",
"with",
"regular",
"expression",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/util/DateTimeHelper.java#L84-L117 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/gremlin/optimizer/ExpandOrsOptimization.java | ExpandOrsOptimization.expandOrs | private List<GroovyExpression> expandOrs(GroovyExpression expr, OptimizationContext context) {
if (GremlinQueryOptimizer.isOrExpression(expr)) {
return expandOrFunction(expr, context);
}
return processOtherExpression(expr, context);
} | java | private List<GroovyExpression> expandOrs(GroovyExpression expr, OptimizationContext context) {
if (GremlinQueryOptimizer.isOrExpression(expr)) {
return expandOrFunction(expr, context);
}
return processOtherExpression(expr, context);
} | [
"private",
"List",
"<",
"GroovyExpression",
">",
"expandOrs",
"(",
"GroovyExpression",
"expr",
",",
"OptimizationContext",
"context",
")",
"{",
"if",
"(",
"GremlinQueryOptimizer",
".",
"isOrExpression",
"(",
"expr",
")",
")",
"{",
"return",
"expandOrFunction",
"("... | Recursively traverses the given expression, expanding or expressions
wherever they are found.
@param expr
@param context
@return expressions that should be unioned together to get the query result | [
"Recursively",
"traverses",
"the",
"given",
"expression",
"expanding",
"or",
"expressions",
"wherever",
"they",
"are",
"found",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/gremlin/optimizer/ExpandOrsOptimization.java#L350-L356 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/gremlin/optimizer/ExpandOrsOptimization.java | ExpandOrsOptimization.expandOrFunction | private List<GroovyExpression> expandOrFunction(GroovyExpression expr, OptimizationContext context) {
FunctionCallExpression functionCall = (FunctionCallExpression) expr;
GroovyExpression caller = functionCall.getCaller();
List<GroovyExpression> updatedCallers = null;
if (caller != null)... | java | private List<GroovyExpression> expandOrFunction(GroovyExpression expr, OptimizationContext context) {
FunctionCallExpression functionCall = (FunctionCallExpression) expr;
GroovyExpression caller = functionCall.getCaller();
List<GroovyExpression> updatedCallers = null;
if (caller != null)... | [
"private",
"List",
"<",
"GroovyExpression",
">",
"expandOrFunction",
"(",
"GroovyExpression",
"expr",
",",
"OptimizationContext",
"context",
")",
"{",
"FunctionCallExpression",
"functionCall",
"=",
"(",
"FunctionCallExpression",
")",
"expr",
";",
"GroovyExpression",
"ca... | This method takes an 'or' expression and expands it into multiple expressions.
For example:
g.V().or(has('x'),has('y')
is expanded to:
g.V().has('x')
g.V().has('y')
There are certain cases where it is not safe to move an expression out
of the 'or'. For example, in the expression
g.V().or(has('x').out('y'),has('z... | [
"This",
"method",
"takes",
"an",
"or",
"expression",
"and",
"expands",
"it",
"into",
"multiple",
"expressions",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/gremlin/optimizer/ExpandOrsOptimization.java#L391-L430 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/gremlin/optimizer/ExpandOrsOptimization.java | ExpandOrsOptimization.processOtherExpression | private List<GroovyExpression> processOtherExpression(GroovyExpression source, OptimizationContext context) {
UpdatedExpressions updatedChildren = getUpdatedChildren(source, context);
if (!updatedChildren.hasChanges()) {
return Collections.singletonList(source);
}
List<Groovy... | java | private List<GroovyExpression> processOtherExpression(GroovyExpression source, OptimizationContext context) {
UpdatedExpressions updatedChildren = getUpdatedChildren(source, context);
if (!updatedChildren.hasChanges()) {
return Collections.singletonList(source);
}
List<Groovy... | [
"private",
"List",
"<",
"GroovyExpression",
">",
"processOtherExpression",
"(",
"GroovyExpression",
"source",
",",
"OptimizationContext",
"context",
")",
"{",
"UpdatedExpressions",
"updatedChildren",
"=",
"getUpdatedChildren",
"(",
"source",
",",
"context",
")",
";",
... | This is called when we encounter an expression that is not an "or", for example an "and" expressio. For these
expressions, we process the children and create copies with the cartesian product of the updated
arguments.
Example:
g.V().and(or(has('x),has('y'), or(has('a'),has('b')))
Here, we have an "and" expression w... | [
"This",
"is",
"called",
"when",
"we",
"encounter",
"an",
"expression",
"that",
"is",
"not",
"an",
"or",
"for",
"example",
"an",
"and",
"expressio",
".",
"For",
"these",
"expressions",
"we",
"process",
"the",
"children",
"and",
"create",
"copies",
"with",
"... | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/gremlin/optimizer/ExpandOrsOptimization.java#L487-L503 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java | AtlasAbstractAuthenticationProvider.getAuthorities | protected List<GrantedAuthority> getAuthorities(String username) {
final List<GrantedAuthority> grantedAuths = new ArrayList<>();
grantedAuths.add(new SimpleGrantedAuthority("DATA_SCIENTIST"));
return grantedAuths;
} | java | protected List<GrantedAuthority> getAuthorities(String username) {
final List<GrantedAuthority> grantedAuths = new ArrayList<>();
grantedAuths.add(new SimpleGrantedAuthority("DATA_SCIENTIST"));
return grantedAuths;
} | [
"protected",
"List",
"<",
"GrantedAuthority",
">",
"getAuthorities",
"(",
"String",
"username",
")",
"{",
"final",
"List",
"<",
"GrantedAuthority",
">",
"grantedAuths",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"grantedAuths",
".",
"add",
"(",
"new",
"Si... | This method will be modified when actual roles are introduced. | [
"This",
"method",
"will",
"be",
"modified",
"when",
"actual",
"roles",
"are",
"introduced",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/security/AtlasAbstractAuthenticationProvider.java#L71-L75 | train |
apache/incubator-atlas | notification/src/main/java/org/apache/atlas/notification/VersionedMessageDeserializer.java | VersionedMessageDeserializer.checkVersion | protected void checkVersion(VersionedMessage<T> versionedMessage, String messageJson) {
int comp = versionedMessage.compareVersion(expectedVersion);
// message has newer version
if (comp > 0) {
String msg =
String.format(VERSION_MISMATCH_MSG, expectedVersion, ver... | java | protected void checkVersion(VersionedMessage<T> versionedMessage, String messageJson) {
int comp = versionedMessage.compareVersion(expectedVersion);
// message has newer version
if (comp > 0) {
String msg =
String.format(VERSION_MISMATCH_MSG, expectedVersion, ver... | [
"protected",
"void",
"checkVersion",
"(",
"VersionedMessage",
"<",
"T",
">",
"versionedMessage",
",",
"String",
"messageJson",
")",
"{",
"int",
"comp",
"=",
"versionedMessage",
".",
"compareVersion",
"(",
"expectedVersion",
")",
";",
"// message has newer version",
... | Check the message version against the expected version.
@param versionedMessage the versioned message
@param messageJson the notification message json
@throws IncompatibleVersionException if the message version is incompatable with the expected version | [
"Check",
"the",
"message",
"version",
"against",
"the",
"expected",
"version",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/notification/src/main/java/org/apache/atlas/notification/VersionedMessageDeserializer.java#L88-L104 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/discovery/DataSetLineageService.java | DataSetLineageService.getOutputsGraph | @Override
@GraphTransaction
public String getOutputsGraph(String datasetName) throws AtlasException {
LOG.info("Fetching lineage outputs graph for datasetName={}", datasetName);
datasetName = ParamChecker.notEmpty(datasetName, "dataset name");
TypeUtils.Pair<String, String> typeIdPair = ... | java | @Override
@GraphTransaction
public String getOutputsGraph(String datasetName) throws AtlasException {
LOG.info("Fetching lineage outputs graph for datasetName={}", datasetName);
datasetName = ParamChecker.notEmpty(datasetName, "dataset name");
TypeUtils.Pair<String, String> typeIdPair = ... | [
"@",
"Override",
"@",
"GraphTransaction",
"public",
"String",
"getOutputsGraph",
"(",
"String",
"datasetName",
")",
"throws",
"AtlasException",
"{",
"LOG",
".",
"info",
"(",
"\"Fetching lineage outputs graph for datasetName={}\"",
",",
"datasetName",
")",
";",
"datasetN... | Return the lineage outputs graph for the given datasetName.
@param datasetName datasetName
@return Outputs Graph as JSON | [
"Return",
"the",
"lineage",
"outputs",
"graph",
"for",
"the",
"given",
"datasetName",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/discovery/DataSetLineageService.java#L106-L113 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/discovery/DataSetLineageService.java | DataSetLineageService.getInputsGraph | @Override
@GraphTransaction
public String getInputsGraph(String tableName) throws AtlasException {
LOG.info("Fetching lineage inputs graph for tableName={}", tableName);
tableName = ParamChecker.notEmpty(tableName, "table name");
TypeUtils.Pair<String, String> typeIdPair = validateDatase... | java | @Override
@GraphTransaction
public String getInputsGraph(String tableName) throws AtlasException {
LOG.info("Fetching lineage inputs graph for tableName={}", tableName);
tableName = ParamChecker.notEmpty(tableName, "table name");
TypeUtils.Pair<String, String> typeIdPair = validateDatase... | [
"@",
"Override",
"@",
"GraphTransaction",
"public",
"String",
"getInputsGraph",
"(",
"String",
"tableName",
")",
"throws",
"AtlasException",
"{",
"LOG",
".",
"info",
"(",
"\"Fetching lineage inputs graph for tableName={}\"",
",",
"tableName",
")",
";",
"tableName",
"=... | Return the lineage inputs graph for the given tableName.
@param tableName tableName
@return Inputs Graph as JSON | [
"Return",
"the",
"lineage",
"inputs",
"graph",
"for",
"the",
"given",
"tableName",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/discovery/DataSetLineageService.java#L121-L128 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/discovery/DataSetLineageService.java | DataSetLineageService.getSchema | @Override
@GraphTransaction
public String getSchema(String datasetName) throws AtlasException {
datasetName = ParamChecker.notEmpty(datasetName, "table name");
LOG.info("Fetching schema for tableName={}", datasetName);
TypeUtils.Pair<String, String> typeIdPair = validateDatasetNameExists... | java | @Override
@GraphTransaction
public String getSchema(String datasetName) throws AtlasException {
datasetName = ParamChecker.notEmpty(datasetName, "table name");
LOG.info("Fetching schema for tableName={}", datasetName);
TypeUtils.Pair<String, String> typeIdPair = validateDatasetNameExists... | [
"@",
"Override",
"@",
"GraphTransaction",
"public",
"String",
"getSchema",
"(",
"String",
"datasetName",
")",
"throws",
"AtlasException",
"{",
"datasetName",
"=",
"ParamChecker",
".",
"notEmpty",
"(",
"datasetName",
",",
"\"table name\"",
")",
";",
"LOG",
".",
"... | Return the schema for the given tableName.
@param datasetName tableName
@return Schema as JSON | [
"Return",
"the",
"schema",
"for",
"the",
"given",
"tableName",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/discovery/DataSetLineageService.java#L173-L181 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java | RelationshipREST.create | @POST
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasRelationship create(AtlasRelationship relationship) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf =... | java | @POST
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasRelationship create(AtlasRelationship relationship) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf =... | [
"@",
"POST",
"@",
"Consumes",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"AtlasRelationship",
"create",
"(",
"AtlasRelationship",
"relationship",
")",
"throws",
"AtlasBaseException",
"{",
... | Create a new relationship between entities. | [
"Create",
"a",
"new",
"relationship",
"between",
"entities",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java#L59-L75 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java | RelationshipREST.update | @PUT
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasRelationship update(AtlasRelationship relationship) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = ... | java | @PUT
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasRelationship update(AtlasRelationship relationship) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
perf = ... | [
"@",
"PUT",
"@",
"Consumes",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"AtlasRelationship",
"update",
"(",
"AtlasRelationship",
"relationship",
")",
"throws",
"AtlasBaseException",
"{",
"... | Update an existing relationship between entities. | [
"Update",
"an",
"existing",
"relationship",
"between",
"entities",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java#L80-L96 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java | RelationshipREST.getById | @GET
@Path("/guid/{guid}")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasRelationship getById(@PathParam("guid") String guid) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)... | java | @GET
@Path("/guid/{guid}")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasRelationship getById(@PathParam("guid") String guid) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/guid/{guid}\"",
")",
"@",
"Consumes",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"AtlasRelationship",
"getById",
"(",
"@",
"PathParam",
"(",
"\"guid\"... | Get relationship information between entities using guid. | [
"Get",
"relationship",
"information",
"between",
"entities",
"using",
"guid",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java#L101-L118 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java | RelationshipREST.deleteById | @DELETE
@Path("/guid/{guid}")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public void deleteById(@PathParam("guid") String guid) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
... | java | @DELETE
@Path("/guid/{guid}")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public void deleteById(@PathParam("guid") String guid) throws AtlasBaseException {
AtlasPerfTracer perf = null;
try {
if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
... | [
"@",
"DELETE",
"@",
"Path",
"(",
"\"/guid/{guid}\"",
")",
"@",
"Consumes",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"void",
"deleteById",
"(",
"@",
"PathParam",
"(",
"\"guid\"",
")... | Delete a relationship between entities using guid. | [
"Delete",
"a",
"relationship",
"between",
"entities",
"using",
"guid",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/rest/RelationshipREST.java#L123-L139 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepository.java | GraphBackedMetadataRepository.addTrait | @Override
@GraphTransaction
public void addTrait(List<String> entityGuids, ITypedStruct traitInstance) throws RepositoryException {
Preconditions.checkNotNull(entityGuids, "entityGuids list cannot be null");
Preconditions.checkNotNull(traitInstance, "Trait instance cannot be null");
if ... | java | @Override
@GraphTransaction
public void addTrait(List<String> entityGuids, ITypedStruct traitInstance) throws RepositoryException {
Preconditions.checkNotNull(entityGuids, "entityGuids list cannot be null");
Preconditions.checkNotNull(traitInstance, "Trait instance cannot be null");
if ... | [
"@",
"Override",
"@",
"GraphTransaction",
"public",
"void",
"addTrait",
"(",
"List",
"<",
"String",
">",
"entityGuids",
",",
"ITypedStruct",
"traitInstance",
")",
"throws",
"RepositoryException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"entityGuids",
",",
... | Adds a new trait to the list of entities represented by their respective guids
@param entityGuids list of globally unique identifier for the entities
@param traitInstance trait instance that needs to be added to entities
@throws RepositoryException | [
"Adds",
"a",
"new",
"trait",
"to",
"the",
"list",
"of",
"entities",
"represented",
"by",
"their",
"respective",
"guids"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedMetadataRepository.java#L306-L320 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java | GraphBackedTypeStore.findVertex | AtlasVertex findVertex(DataTypes.TypeCategory category, String typeName) {
LOG.debug("Finding AtlasVertex for {}.{}", category, typeName);
Iterator results = graph.query().has(Constants.TYPENAME_PROPERTY_KEY, typeName).vertices().iterator();
AtlasVertex vertex = null;
if (results != nul... | java | AtlasVertex findVertex(DataTypes.TypeCategory category, String typeName) {
LOG.debug("Finding AtlasVertex for {}.{}", category, typeName);
Iterator results = graph.query().has(Constants.TYPENAME_PROPERTY_KEY, typeName).vertices().iterator();
AtlasVertex vertex = null;
if (results != nul... | [
"AtlasVertex",
"findVertex",
"(",
"DataTypes",
".",
"TypeCategory",
"category",
",",
"String",
"typeName",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"Finding AtlasVertex for {}.{}\"",
",",
"category",
",",
"typeName",
")",
";",
"Iterator",
"results",
"=",
"graph",
"... | Find vertex for the given type category and name, else create new vertex
@param category
@param typeName
@return vertex | [
"Find",
"vertex",
"for",
"the",
"given",
"type",
"category",
"and",
"name",
"else",
"create",
"new",
"vertex"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java#L333-L343 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java | GraphBackedTypeStore.createVertices | private List<AtlasVertex> createVertices(List<TypeVertexInfo> infoList) throws AtlasException {
List<AtlasVertex> result = new ArrayList<>(infoList.size());
List<String> typeNames = Lists.transform(infoList, new Function<TypeVertexInfo,String>() {
@Override
public String apply(T... | java | private List<AtlasVertex> createVertices(List<TypeVertexInfo> infoList) throws AtlasException {
List<AtlasVertex> result = new ArrayList<>(infoList.size());
List<String> typeNames = Lists.transform(infoList, new Function<TypeVertexInfo,String>() {
@Override
public String apply(T... | [
"private",
"List",
"<",
"AtlasVertex",
">",
"createVertices",
"(",
"List",
"<",
"TypeVertexInfo",
">",
"infoList",
")",
"throws",
"AtlasException",
"{",
"List",
"<",
"AtlasVertex",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
"infoList",
".",
"size",
"... | Finds or creates type vertices with the information specified.
@param infoList
@return list with the vertices corresponding to the types in the list.
@throws AtlasException | [
"Finds",
"or",
"creates",
"type",
"vertices",
"with",
"the",
"information",
"specified",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/typestore/GraphBackedTypeStore.java#L361-L393 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/typestore/StoreBackedTypeCache.java | StoreBackedTypeCache.onTypeFault | @Override
public IDataType onTypeFault(String typeName) throws AtlasException {
// Type is not cached - check the type store.
// Any super and attribute types needed by the requested type
// which are not cached will also be loaded from the store.
Context context = new Context();
... | java | @Override
public IDataType onTypeFault(String typeName) throws AtlasException {
// Type is not cached - check the type store.
// Any super and attribute types needed by the requested type
// which are not cached will also be loaded from the store.
Context context = new Context();
... | [
"@",
"Override",
"public",
"IDataType",
"onTypeFault",
"(",
"String",
"typeName",
")",
"throws",
"AtlasException",
"{",
"// Type is not cached - check the type store.",
"// Any super and attribute types needed by the requested type",
"// which are not cached will also be loaded from the ... | Check the type store for the requested type.
If found in the type store, the type and any required super and attribute types
are loaded from the type store, and added to the cache. | [
"Check",
"the",
"type",
"store",
"for",
"the",
"requested",
"type",
".",
"If",
"found",
"in",
"the",
"type",
"store",
"the",
"type",
"and",
"any",
"required",
"super",
"and",
"attribute",
"types",
"are",
"loaded",
"from",
"the",
"type",
"store",
"and",
"... | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/typestore/StoreBackedTypeCache.java#L129-L147 | train |
apache/incubator-atlas | common/src/main/java/org/apache/atlas/utils/LruCache.java | LruCache.evictionWarningIfNeeded | private void evictionWarningIfNeeded() {
// If not logging eviction warnings, just return.
if (evictionWarningThrottle <= 0) {
return;
}
evictionsSinceWarning++;
if (evictionsSinceWarning >= evictionWarningThrottle) {
DateFormat dateFormat = DateFormat.g... | java | private void evictionWarningIfNeeded() {
// If not logging eviction warnings, just return.
if (evictionWarningThrottle <= 0) {
return;
}
evictionsSinceWarning++;
if (evictionsSinceWarning >= evictionWarningThrottle) {
DateFormat dateFormat = DateFormat.g... | [
"private",
"void",
"evictionWarningIfNeeded",
"(",
")",
"{",
"// If not logging eviction warnings, just return.",
"if",
"(",
"evictionWarningThrottle",
"<=",
"0",
")",
"{",
"return",
";",
"}",
"evictionsSinceWarning",
"++",
";",
"if",
"(",
"evictionsSinceWarning",
">=",... | Logs a warning if a threshold number of evictions has occurred since the
last warning. | [
"Logs",
"a",
"warning",
"if",
"a",
"threshold",
"number",
"of",
"evictions",
"has",
"occurred",
"since",
"the",
"last",
"warning",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/common/src/main/java/org/apache/atlas/utils/LruCache.java#L77-L95 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/rest/LineageREST.java | LineageREST.getLineageGraph | @GET
@Path("/{guid}")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasLineageInfo getLineageGraph(@PathParam("guid") String guid,
@QueryParam("direction") @DefaultValue(DEFAULT_DIRECTION) LineageDirection direction,
... | java | @GET
@Path("/{guid}")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public AtlasLineageInfo getLineageGraph(@PathParam("guid") String guid,
@QueryParam("direction") @DefaultValue(DEFAULT_DIRECTION) LineageDirection direction,
... | [
"@",
"GET",
"@",
"Path",
"(",
"\"/{guid}\"",
")",
"@",
"Consumes",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"AtlasLineageInfo",
"getLineageGraph",
"(",
"@",
"PathParam",
"(",
"\"guid... | Returns lineage info about entity.
@param guid - unique entity id
@param direction - input, output or both
@param depth - number of hops for lineage
@return AtlasLineageInfo
@throws AtlasBaseException
@HTTP 200 If Lineage exists for the given entity
@HTTP 400 Bad query parameters
@HTTP 404 If no lineage is found for th... | [
"Returns",
"lineage",
"info",
"about",
"entity",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/rest/LineageREST.java#L75-L94 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java | GraphBackedSearchIndexer.initialize | private void initialize(AtlasGraph graph) throws RepositoryException, IndexException {
AtlasGraphManagement management = graph.getManagementSystem();
try {
if (management.containsPropertyKey(Constants.VERTEX_TYPE_PROPERTY_KEY)) {
LOG.info("Global indexes already exist for gr... | java | private void initialize(AtlasGraph graph) throws RepositoryException, IndexException {
AtlasGraphManagement management = graph.getManagementSystem();
try {
if (management.containsPropertyKey(Constants.VERTEX_TYPE_PROPERTY_KEY)) {
LOG.info("Global indexes already exist for gr... | [
"private",
"void",
"initialize",
"(",
"AtlasGraph",
"graph",
")",
"throws",
"RepositoryException",
",",
"IndexException",
"{",
"AtlasGraphManagement",
"management",
"=",
"graph",
".",
"getManagementSystem",
"(",
")",
";",
"try",
"{",
"if",
"(",
"management",
".",
... | Initializes the indices for the graph - create indices for Global AtlasVertex Keys | [
"Initializes",
"the",
"indices",
"for",
"the",
"graph",
"-",
"create",
"indices",
"for",
"Global",
"AtlasVertex",
"Keys"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java#L131-L200 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java | GraphBackedSearchIndexer.onAdd | @Override
public void onAdd(Collection<? extends IDataType> dataTypes) throws AtlasException {
AtlasGraphManagement management = provider.get().getManagementSystem();
for (IDataType dataType : dataTypes) {
if (LOG.isDebugEnabled()) {
LOG.debug("Creating in... | java | @Override
public void onAdd(Collection<? extends IDataType> dataTypes) throws AtlasException {
AtlasGraphManagement management = provider.get().getManagementSystem();
for (IDataType dataType : dataTypes) {
if (LOG.isDebugEnabled()) {
LOG.debug("Creating in... | [
"@",
"Override",
"public",
"void",
"onAdd",
"(",
"Collection",
"<",
"?",
"extends",
"IDataType",
">",
"dataTypes",
")",
"throws",
"AtlasException",
"{",
"AtlasGraphManagement",
"management",
"=",
"provider",
".",
"get",
"(",
")",
".",
"getManagementSystem",
"(",... | This is upon adding a new type to Store.
@param dataTypes data type
@throws AtlasException | [
"This",
"is",
"upon",
"adding",
"a",
"new",
"type",
"to",
"Store",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java#L226-L248 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java | GraphBackedSearchIndexer.instanceIsActive | @Override
public void instanceIsActive() throws AtlasException {
LOG.info("Reacting to active: initializing index");
try {
initialize();
} catch (RepositoryException | IndexException e) {
throw new AtlasException("Error in reacting to active on initialization", e);
... | java | @Override
public void instanceIsActive() throws AtlasException {
LOG.info("Reacting to active: initializing index");
try {
initialize();
} catch (RepositoryException | IndexException e) {
throw new AtlasException("Error in reacting to active on initialization", e);
... | [
"@",
"Override",
"public",
"void",
"instanceIsActive",
"(",
")",
"throws",
"AtlasException",
"{",
"LOG",
".",
"info",
"(",
"\"Reacting to active: initializing index\"",
")",
";",
"try",
"{",
"initialize",
"(",
")",
";",
"}",
"catch",
"(",
"RepositoryException",
... | Initialize global indices for Titan graph on server activation.
Since the indices are shared state, we need to do this only from an active instance. | [
"Initialize",
"global",
"indices",
"for",
"Titan",
"graph",
"on",
"server",
"activation",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/graph/GraphBackedSearchIndexer.java#L637-L645 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/CreateUpdateEntitiesResult.java | CreateUpdateEntitiesResult.fromJson | public static CreateUpdateEntitiesResult fromJson(String json) throws AtlasServiceException {
GuidMapping guidMapping = AtlasType.fromJson(json, GuidMapping.class);
EntityResult entityResult = EntityResult.fromString(json);
CreateUpdateEntitiesResult result = new CreateUpdateEntitiesResult();
... | java | public static CreateUpdateEntitiesResult fromJson(String json) throws AtlasServiceException {
GuidMapping guidMapping = AtlasType.fromJson(json, GuidMapping.class);
EntityResult entityResult = EntityResult.fromString(json);
CreateUpdateEntitiesResult result = new CreateUpdateEntitiesResult();
... | [
"public",
"static",
"CreateUpdateEntitiesResult",
"fromJson",
"(",
"String",
"json",
")",
"throws",
"AtlasServiceException",
"{",
"GuidMapping",
"guidMapping",
"=",
"AtlasType",
".",
"fromJson",
"(",
"json",
",",
"GuidMapping",
".",
"class",
")",
";",
"EntityResult"... | Deserializes the given json into an instance of
CreateUpdateEntitiesResult.
@param json
the (unmodified) json that comes back from Atlas.
@return
@throws AtlasServiceException | [
"Deserializes",
"the",
"given",
"json",
"into",
"an",
"instance",
"of",
"CreateUpdateEntitiesResult",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/CreateUpdateEntitiesResult.java#L80-L88 | train |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java | AtlasRelationshipDefStoreV1.preUpdateCheck | public static void preUpdateCheck(AtlasRelationshipDef newRelationshipDef, AtlasRelationshipDef existingRelationshipDef) throws AtlasBaseException {
// do not allow renames of the Def.
String existingName = existingRelationshipDef.getName();
String newName = newRelationshipDef.getName();
... | java | public static void preUpdateCheck(AtlasRelationshipDef newRelationshipDef, AtlasRelationshipDef existingRelationshipDef) throws AtlasBaseException {
// do not allow renames of the Def.
String existingName = existingRelationshipDef.getName();
String newName = newRelationshipDef.getName();
... | [
"public",
"static",
"void",
"preUpdateCheck",
"(",
"AtlasRelationshipDef",
"newRelationshipDef",
",",
"AtlasRelationshipDef",
"existingRelationshipDef",
")",
"throws",
"AtlasBaseException",
"{",
"// do not allow renames of the Def.",
"String",
"existingName",
"=",
"existingRelati... | Check ends are the same and relationshipCategory is the same.
We do this by comparing 2 relationshipDefs to avoid exposing the AtlasVertex to unit testing.
@param newRelationshipDef
@param existingRelationshipDef
@throws AtlasBaseException | [
"Check",
"ends",
"are",
"the",
"same",
"and",
"relationshipCategory",
"is",
"the",
"same",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasRelationshipDefStoreV1.java#L442-L476 | train |
apache/incubator-atlas | server-api/src/main/java/org/apache/atlas/ha/AtlasServerIdSelector.java | AtlasServerIdSelector.selectServerId | public static String selectServerId(Configuration configuration) throws AtlasException {
// ids are already trimmed by this method
String[] ids = configuration.getStringArray(HAConfiguration.ATLAS_SERVER_IDS);
String matchingServerId = null;
int appPort = Integer.parseInt(System.getPrope... | java | public static String selectServerId(Configuration configuration) throws AtlasException {
// ids are already trimmed by this method
String[] ids = configuration.getStringArray(HAConfiguration.ATLAS_SERVER_IDS);
String matchingServerId = null;
int appPort = Integer.parseInt(System.getPrope... | [
"public",
"static",
"String",
"selectServerId",
"(",
"Configuration",
"configuration",
")",
"throws",
"AtlasException",
"{",
"// ids are already trimmed by this method",
"String",
"[",
"]",
"ids",
"=",
"configuration",
".",
"getStringArray",
"(",
"HAConfiguration",
".",
... | Return the ID corresponding to this Atlas instance.
The match is done by looking for an ID configured in {@link HAConfiguration#ATLAS_SERVER_IDS} key
that has a host:port entry for the key {@link HAConfiguration#ATLAS_SERVER_ADDRESS_PREFIX}+ID where
the host is a local IP address and port is set in the system property... | [
"Return",
"the",
"ID",
"corresponding",
"to",
"this",
"Atlas",
"instance",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/server-api/src/main/java/org/apache/atlas/ha/AtlasServerIdSelector.java#L47-L80 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/resources/LineageResource.java | LineageResource.outputsGraph | @GET
@Path("{guid}/outputs/graph")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response outputsGraph(@PathParam("guid") String guid) {
if (LOG.isDebugEnabled()) {
LOG.debug("==> LineageResource.outputsGraph({})", guid);
}
AtlasPerfT... | java | @GET
@Path("{guid}/outputs/graph")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response outputsGraph(@PathParam("guid") String guid) {
if (LOG.isDebugEnabled()) {
LOG.debug("==> LineageResource.outputsGraph({})", guid);
}
AtlasPerfT... | [
"@",
"GET",
"@",
"Path",
"(",
"\"{guid}/outputs/graph\"",
")",
"@",
"Consumes",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"Response",
"outputsGraph",
"(",
"@",
"PathParam",
"(",
"\"gu... | Returns the outputs graph for a given entity id.
@param guid dataset entity id | [
"Returns",
"the",
"outputs",
"graph",
"for",
"a",
"given",
"entity",
"id",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/resources/LineageResource.java#L126-L166 | train |
apache/incubator-atlas | webapp/src/main/java/org/apache/atlas/web/resources/LineageResource.java | LineageResource.schema | @GET
@Path("{guid}/schema")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response schema(@PathParam("guid") String guid) {
if (LOG.isDebugEnabled()) {
LOG.debug("==> LineageResource.schema({})", guid);
}
AtlasPerfTracer perf = null;
... | java | @GET
@Path("{guid}/schema")
@Consumes(Servlets.JSON_MEDIA_TYPE)
@Produces(Servlets.JSON_MEDIA_TYPE)
public Response schema(@PathParam("guid") String guid) {
if (LOG.isDebugEnabled()) {
LOG.debug("==> LineageResource.schema({})", guid);
}
AtlasPerfTracer perf = null;
... | [
"@",
"GET",
"@",
"Path",
"(",
"\"{guid}/schema\"",
")",
"@",
"Consumes",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"@",
"Produces",
"(",
"Servlets",
".",
"JSON_MEDIA_TYPE",
")",
"public",
"Response",
"schema",
"(",
"@",
"PathParam",
"(",
"\"guid\"",
")",... | Returns the schema for the given dataset id.
@param guid dataset entity id | [
"Returns",
"the",
"schema",
"for",
"the",
"given",
"dataset",
"id",
"."
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/webapp/src/main/java/org/apache/atlas/web/resources/LineageResource.java#L173-L217 | train |
apache/incubator-atlas | addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/bridge/FalconBridge.java | FalconBridge.createClusterEntity | public static Referenceable createClusterEntity(final org.apache.falcon.entity.v0.cluster.Cluster cluster) {
LOG.info("Creating cluster Entity : {}", cluster.getName());
Referenceable clusterRef = new Referenceable(FalconDataTypes.FALCON_CLUSTER.getName());
clusterRef.set(AtlasClient.NAME, clu... | java | public static Referenceable createClusterEntity(final org.apache.falcon.entity.v0.cluster.Cluster cluster) {
LOG.info("Creating cluster Entity : {}", cluster.getName());
Referenceable clusterRef = new Referenceable(FalconDataTypes.FALCON_CLUSTER.getName());
clusterRef.set(AtlasClient.NAME, clu... | [
"public",
"static",
"Referenceable",
"createClusterEntity",
"(",
"final",
"org",
".",
"apache",
".",
"falcon",
".",
"entity",
".",
"v0",
".",
"cluster",
".",
"Cluster",
"cluster",
")",
"{",
"LOG",
".",
"info",
"(",
"\"Creating cluster Entity : {}\"",
",",
"clu... | Creates cluster entity
@param cluster ClusterEntity
@return cluster instance reference | [
"Creates",
"cluster",
"entity"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/addons/falcon-bridge/src/main/java/org/apache/atlas/falcon/bridge/FalconBridge.java#L76-L97 | train |
apache/incubator-atlas | notification/src/main/java/org/apache/atlas/kafka/KafkaNotification.java | KafkaNotification.getConsumerProperties | private Properties getConsumerProperties(NotificationType type) {
// find the configured group id for the given notification type
String groupId = properties.getProperty(type.toString().toLowerCase() + "." + CONSUMER_GROUP_ID_PROPERTY);
if (StringUtils.isEmpty(groupId)) {
throw new ... | java | private Properties getConsumerProperties(NotificationType type) {
// find the configured group id for the given notification type
String groupId = properties.getProperty(type.toString().toLowerCase() + "." + CONSUMER_GROUP_ID_PROPERTY);
if (StringUtils.isEmpty(groupId)) {
throw new ... | [
"private",
"Properties",
"getConsumerProperties",
"(",
"NotificationType",
"type",
")",
"{",
"// find the configured group id for the given notification type",
"String",
"groupId",
"=",
"properties",
".",
"getProperty",
"(",
"type",
".",
"toString",
"(",
")",
".",
"toLowe... | Get properties for consumer request | [
"Get",
"properties",
"for",
"consumer",
"request"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/notification/src/main/java/org/apache/atlas/kafka/KafkaNotification.java#L260-L274 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.createTraitType | public List<String> createTraitType(String traitName, ImmutableSet<String> superTraits, AttributeDefinition... attributeDefinitions) throws AtlasServiceException {
HierarchicalTypeDefinition<TraitType> piiTrait =
TypesUtil.createTraitTypeDef(traitName, superTraits, attributeDefinitions);
St... | java | public List<String> createTraitType(String traitName, ImmutableSet<String> superTraits, AttributeDefinition... attributeDefinitions) throws AtlasServiceException {
HierarchicalTypeDefinition<TraitType> piiTrait =
TypesUtil.createTraitTypeDef(traitName, superTraits, attributeDefinitions);
St... | [
"public",
"List",
"<",
"String",
">",
"createTraitType",
"(",
"String",
"traitName",
",",
"ImmutableSet",
"<",
"String",
">",
"superTraits",
",",
"AttributeDefinition",
"...",
"attributeDefinitions",
")",
"throws",
"AtlasServiceException",
"{",
"HierarchicalTypeDefiniti... | Creates trait type with specifiedName, superTraits and attributes
@param traitName the name of the trait type
@param superTraits the list of super traits from which this trait type inherits attributes
@param attributeDefinitions the list of attributes of the trait type
@return the list of types created
@throws AtlasSer... | [
"Creates",
"trait",
"type",
"with",
"specifiedName",
"superTraits",
"and",
"attributes"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L307-L314 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.listTypes | public List<String> listTypes() throws AtlasServiceException {
final JSONObject jsonObject = callAPIWithQueryParams(API.LIST_TYPES, null);
return extractResults(jsonObject, AtlasClient.RESULTS, new ExtractOperation<String, String>());
} | java | public List<String> listTypes() throws AtlasServiceException {
final JSONObject jsonObject = callAPIWithQueryParams(API.LIST_TYPES, null);
return extractResults(jsonObject, AtlasClient.RESULTS, new ExtractOperation<String, String>());
} | [
"public",
"List",
"<",
"String",
">",
"listTypes",
"(",
")",
"throws",
"AtlasServiceException",
"{",
"final",
"JSONObject",
"jsonObject",
"=",
"callAPIWithQueryParams",
"(",
"API",
".",
"LIST_TYPES",
",",
"null",
")",
";",
"return",
"extractResults",
"(",
"jsonO... | Returns all type names in the system
@return list of type names
@throws AtlasServiceException | [
"Returns",
"all",
"type",
"names",
"in",
"the",
"system"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L360-L363 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.listTypes | public List<String> listTypes(final DataTypes.TypeCategory category) throws AtlasServiceException {
JSONObject response = callAPIWithRetries(API.LIST_TYPES, null, new ResourceCreator() {
@Override
public WebResource createResource() {
WebResource resource = getResource(AP... | java | public List<String> listTypes(final DataTypes.TypeCategory category) throws AtlasServiceException {
JSONObject response = callAPIWithRetries(API.LIST_TYPES, null, new ResourceCreator() {
@Override
public WebResource createResource() {
WebResource resource = getResource(AP... | [
"public",
"List",
"<",
"String",
">",
"listTypes",
"(",
"final",
"DataTypes",
".",
"TypeCategory",
"category",
")",
"throws",
"AtlasServiceException",
"{",
"JSONObject",
"response",
"=",
"callAPIWithRetries",
"(",
"API",
".",
"LIST_TYPES",
",",
"null",
",",
"new... | Returns all type names with the given category
@param category
@return list of type names
@throws AtlasServiceException | [
"Returns",
"all",
"type",
"names",
"with",
"the",
"given",
"category"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L371-L381 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.updateEntityAttribute | public EntityResult updateEntityAttribute(final String guid, final String attribute, String value)
throws AtlasServiceException {
LOG.debug("Updating entity id: {}, attribute name: {}, attribute value: {}", guid, attribute, value);
JSONObject response = callAPIWithRetries(API.UPDATE_ENTITY_P... | java | public EntityResult updateEntityAttribute(final String guid, final String attribute, String value)
throws AtlasServiceException {
LOG.debug("Updating entity id: {}, attribute name: {}, attribute value: {}", guid, attribute, value);
JSONObject response = callAPIWithRetries(API.UPDATE_ENTITY_P... | [
"public",
"EntityResult",
"updateEntityAttribute",
"(",
"final",
"String",
"guid",
",",
"final",
"String",
"attribute",
",",
"String",
"value",
")",
"throws",
"AtlasServiceException",
"{",
"LOG",
".",
"debug",
"(",
"\"Updating entity id: {}, attribute name: {}, attribute ... | Supports Partial updates
Updates property for the entity corresponding to guid
@param guid guid
@param attribute property key
@param value property value | [
"Supports",
"Partial",
"updates",
"Updates",
"property",
"for",
"the",
"entity",
"corresponding",
"to",
"guid"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L496-L509 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.addTrait | public void addTrait(String guid, Struct traitDefinition) throws AtlasServiceException {
String traitJson = InstanceSerialization.toJson(traitDefinition, true);
LOG.debug("Adding trait to entity with id {} {}", guid, traitJson);
callAPIWithBodyAndParams(API.ADD_TRAITS, traitJson, guid, URI_TRAIT... | java | public void addTrait(String guid, Struct traitDefinition) throws AtlasServiceException {
String traitJson = InstanceSerialization.toJson(traitDefinition, true);
LOG.debug("Adding trait to entity with id {} {}", guid, traitJson);
callAPIWithBodyAndParams(API.ADD_TRAITS, traitJson, guid, URI_TRAIT... | [
"public",
"void",
"addTrait",
"(",
"String",
"guid",
",",
"Struct",
"traitDefinition",
")",
"throws",
"AtlasServiceException",
"{",
"String",
"traitJson",
"=",
"InstanceSerialization",
".",
"toJson",
"(",
"traitDefinition",
",",
"true",
")",
";",
"LOG",
".",
"de... | Associate trait to an entity
@param guid guid
@param traitDefinition trait definition | [
"Associate",
"trait",
"to",
"an",
"entity"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L530-L534 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.deleteTrait | public void deleteTrait(String guid, String traitName) throws AtlasServiceException {
callAPIWithBodyAndParams(API.DELETE_TRAITS, null, guid, TRAITS, traitName);
} | java | public void deleteTrait(String guid, String traitName) throws AtlasServiceException {
callAPIWithBodyAndParams(API.DELETE_TRAITS, null, guid, TRAITS, traitName);
} | [
"public",
"void",
"deleteTrait",
"(",
"String",
"guid",
",",
"String",
"traitName",
")",
"throws",
"AtlasServiceException",
"{",
"callAPIWithBodyAndParams",
"(",
"API",
".",
"DELETE_TRAITS",
",",
"null",
",",
"guid",
",",
"TRAITS",
",",
"traitName",
")",
";",
... | Delete a trait from the given entity
@param guid guid of the entity
@param traitName trait to be deleted
@throws AtlasServiceException | [
"Delete",
"a",
"trait",
"from",
"the",
"given",
"entity"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L542-L544 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.deleteEntities | public EntityResult deleteEntities(final String ... guids) throws AtlasServiceException {
LOG.debug("Deleting entities: {}", guids);
JSONObject jsonResponse = callAPIWithRetries(API.DELETE_ENTITIES, null, new ResourceCreator() {
@Override
public WebResource createResource() {
... | java | public EntityResult deleteEntities(final String ... guids) throws AtlasServiceException {
LOG.debug("Deleting entities: {}", guids);
JSONObject jsonResponse = callAPIWithRetries(API.DELETE_ENTITIES, null, new ResourceCreator() {
@Override
public WebResource createResource() {
... | [
"public",
"EntityResult",
"deleteEntities",
"(",
"final",
"String",
"...",
"guids",
")",
"throws",
"AtlasServiceException",
"{",
"LOG",
".",
"debug",
"(",
"\"Deleting entities: {}\"",
",",
"guids",
")",
";",
"JSONObject",
"jsonResponse",
"=",
"callAPIWithRetries",
"... | Delete the specified entities from the repository
@param guids guids of entities to delete
@return List of entity ids updated/deleted
@throws AtlasServiceException | [
"Delete",
"the",
"specified",
"entities",
"from",
"the",
"repository"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L591-L607 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.deleteEntity | public EntityResult deleteEntity(String entityType, String uniqueAttributeName, String uniqueAttributeValue)
throws AtlasServiceException {
LOG.debug("Deleting entity type: {}, attributeName: {}, attributeValue: {}", entityType, uniqueAttributeName,
uniqueAttributeValue);
API... | java | public EntityResult deleteEntity(String entityType, String uniqueAttributeName, String uniqueAttributeValue)
throws AtlasServiceException {
LOG.debug("Deleting entity type: {}, attributeName: {}, attributeValue: {}", entityType, uniqueAttributeName,
uniqueAttributeValue);
API... | [
"public",
"EntityResult",
"deleteEntity",
"(",
"String",
"entityType",
",",
"String",
"uniqueAttributeName",
",",
"String",
"uniqueAttributeValue",
")",
"throws",
"AtlasServiceException",
"{",
"LOG",
".",
"debug",
"(",
"\"Deleting entity type: {}, attributeName: {}, attribute... | Supports Deletion of an entity identified by its unique attribute value
@param entityType Type of the entity being deleted
@param uniqueAttributeName Attribute Name that uniquely identifies the entity
@param uniqueAttributeValue Attribute Value that uniquely identifies the entity
@return List of entity ids updated/dele... | [
"Supports",
"Deletion",
"of",
"an",
"entity",
"identified",
"by",
"its",
"unique",
"attribute",
"value"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L616-L629 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.listEntities | public List<String> listEntities(final String entityType) throws AtlasServiceException {
JSONObject jsonResponse = callAPIWithRetries(API.LIST_ENTITIES, null, new ResourceCreator() {
@Override
public WebResource createResource() {
WebResource resource = getResource(API.LI... | java | public List<String> listEntities(final String entityType) throws AtlasServiceException {
JSONObject jsonResponse = callAPIWithRetries(API.LIST_ENTITIES, null, new ResourceCreator() {
@Override
public WebResource createResource() {
WebResource resource = getResource(API.LI... | [
"public",
"List",
"<",
"String",
">",
"listEntities",
"(",
"final",
"String",
"entityType",
")",
"throws",
"AtlasServiceException",
"{",
"JSONObject",
"jsonResponse",
"=",
"callAPIWithRetries",
"(",
"API",
".",
"LIST_ENTITIES",
",",
"null",
",",
"new",
"ResourceCr... | List entities for a given entity type
@param entityType
@return
@throws AtlasServiceException | [
"List",
"entities",
"for",
"a",
"given",
"entity",
"type"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L689-L699 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.listTraits | public List<String> listTraits(final String guid) throws AtlasServiceException {
JSONObject jsonResponse = callAPIWithBodyAndParams(API.LIST_TRAITS, null, guid, URI_TRAITS);
return extractResults(jsonResponse, AtlasClient.RESULTS, new ExtractOperation<String, String>());
} | java | public List<String> listTraits(final String guid) throws AtlasServiceException {
JSONObject jsonResponse = callAPIWithBodyAndParams(API.LIST_TRAITS, null, guid, URI_TRAITS);
return extractResults(jsonResponse, AtlasClient.RESULTS, new ExtractOperation<String, String>());
} | [
"public",
"List",
"<",
"String",
">",
"listTraits",
"(",
"final",
"String",
"guid",
")",
"throws",
"AtlasServiceException",
"{",
"JSONObject",
"jsonResponse",
"=",
"callAPIWithBodyAndParams",
"(",
"API",
".",
"LIST_TRAITS",
",",
"null",
",",
"guid",
",",
"URI_TR... | List traits for a given entity identified by its GUID
@param guid GUID of the entity
@return List<String> - traitnames associated with entity
@throws AtlasServiceException | [
"List",
"traits",
"for",
"a",
"given",
"entity",
"identified",
"by",
"its",
"GUID"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L707-L710 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.listTraitDefinitions | public List<Struct> listTraitDefinitions(final String guid) throws AtlasServiceException{
JSONObject jsonResponse = callAPIWithBodyAndParams(API.GET_ALL_TRAIT_DEFINITIONS, null, guid, TRAIT_DEFINITIONS);
List<JSONObject> traitDefList = extractResults(jsonResponse, AtlasClient.RESULTS, new ExtractOperati... | java | public List<Struct> listTraitDefinitions(final String guid) throws AtlasServiceException{
JSONObject jsonResponse = callAPIWithBodyAndParams(API.GET_ALL_TRAIT_DEFINITIONS, null, guid, TRAIT_DEFINITIONS);
List<JSONObject> traitDefList = extractResults(jsonResponse, AtlasClient.RESULTS, new ExtractOperati... | [
"public",
"List",
"<",
"Struct",
">",
"listTraitDefinitions",
"(",
"final",
"String",
"guid",
")",
"throws",
"AtlasServiceException",
"{",
"JSONObject",
"jsonResponse",
"=",
"callAPIWithBodyAndParams",
"(",
"API",
".",
"GET_ALL_TRAIT_DEFINITIONS",
",",
"null",
",",
... | Get all trait definitions for an entity
@param guid GUID of the entity
@return List<String> trait definitions of the traits associated to the entity
@throws AtlasServiceException | [
"Get",
"all",
"trait",
"definitions",
"for",
"an",
"entity"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L718-L727 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.getTraitDefinition | public Struct getTraitDefinition(final String guid, final String traitName) throws AtlasServiceException{
JSONObject jsonResponse = callAPIWithBodyAndParams(API.GET_TRAIT_DEFINITION, null, guid, TRAIT_DEFINITIONS, traitName);
try {
return InstanceSerialization.fromJsonStruct(jsonResponse.ge... | java | public Struct getTraitDefinition(final String guid, final String traitName) throws AtlasServiceException{
JSONObject jsonResponse = callAPIWithBodyAndParams(API.GET_TRAIT_DEFINITION, null, guid, TRAIT_DEFINITIONS, traitName);
try {
return InstanceSerialization.fromJsonStruct(jsonResponse.ge... | [
"public",
"Struct",
"getTraitDefinition",
"(",
"final",
"String",
"guid",
",",
"final",
"String",
"traitName",
")",
"throws",
"AtlasServiceException",
"{",
"JSONObject",
"jsonResponse",
"=",
"callAPIWithBodyAndParams",
"(",
"API",
".",
"GET_TRAIT_DEFINITION",
",",
"nu... | Get trait definition for a given entity and traitname
@param guid GUID of the entity
@param traitName
@return trait definition
@throws AtlasServiceException | [
"Get",
"trait",
"definition",
"for",
"a",
"given",
"entity",
"and",
"traitname"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L736-L744 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.getEntityAuditEvents | public List<EntityAuditEvent> getEntityAuditEvents(String entityId, short numResults)
throws AtlasServiceException {
return getEntityAuditEvents(entityId, null, numResults);
} | java | public List<EntityAuditEvent> getEntityAuditEvents(String entityId, short numResults)
throws AtlasServiceException {
return getEntityAuditEvents(entityId, null, numResults);
} | [
"public",
"List",
"<",
"EntityAuditEvent",
">",
"getEntityAuditEvents",
"(",
"String",
"entityId",
",",
"short",
"numResults",
")",
"throws",
"AtlasServiceException",
"{",
"return",
"getEntityAuditEvents",
"(",
"entityId",
",",
"null",
",",
"numResults",
")",
";",
... | Get the latest numResults entity audit events in decreasing order of timestamp for the given entity id
@param entityId entity id
@param numResults number of results to be returned
@return list of audit events for the entity id
@throws AtlasServiceException | [
"Get",
"the",
"latest",
"numResults",
"entity",
"audit",
"events",
"in",
"decreasing",
"order",
"of",
"timestamp",
"for",
"the",
"given",
"entity",
"id"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L774-L777 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.searchByDSL | public JSONArray searchByDSL(final String query, final int limit, final int offset) throws AtlasServiceException {
LOG.debug("DSL query: {}", query);
JSONObject result = callAPIWithRetries(API.SEARCH_DSL, null, new ResourceCreator() {
@Override
public WebResource createResource()... | java | public JSONArray searchByDSL(final String query, final int limit, final int offset) throws AtlasServiceException {
LOG.debug("DSL query: {}", query);
JSONObject result = callAPIWithRetries(API.SEARCH_DSL, null, new ResourceCreator() {
@Override
public WebResource createResource()... | [
"public",
"JSONArray",
"searchByDSL",
"(",
"final",
"String",
"query",
",",
"final",
"int",
"limit",
",",
"final",
"int",
"offset",
")",
"throws",
"AtlasServiceException",
"{",
"LOG",
".",
"debug",
"(",
"\"DSL query: {}\"",
",",
"query",
")",
";",
"JSONObject"... | Search given query DSL
@param query DSL query
@param limit number of rows to be returned in the result, used for pagination. maxlimit > limit > 0. -1 maps to atlas.search.defaultlimit property value
@param offset offset to the results returned, used for pagination. offset >= 0. -1 maps to offset 0
@return result json o... | [
"Search",
"given",
"query",
"DSL"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L840-L857 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.searchByFullText | public JSONObject searchByFullText(final String query, final int limit, final int offset) throws AtlasServiceException {
return callAPIWithRetries(API.SEARCH_FULL_TEXT, null, new ResourceCreator() {
@Override
public WebResource createResource() {
WebResource resource = ge... | java | public JSONObject searchByFullText(final String query, final int limit, final int offset) throws AtlasServiceException {
return callAPIWithRetries(API.SEARCH_FULL_TEXT, null, new ResourceCreator() {
@Override
public WebResource createResource() {
WebResource resource = ge... | [
"public",
"JSONObject",
"searchByFullText",
"(",
"final",
"String",
"query",
",",
"final",
"int",
"limit",
",",
"final",
"int",
"offset",
")",
"throws",
"AtlasServiceException",
"{",
"return",
"callAPIWithRetries",
"(",
"API",
".",
"SEARCH_FULL_TEXT",
",",
"null",... | Search given full text search
@param query Query
@param limit number of rows to be returned in the result, used for pagination. maxlimit > limit > 0. -1 maps to atlas.search.defaultlimit property value
@param offset offset to the results returned, used for pagination. offset >= 0. -1 maps to offset 0
@return result jso... | [
"Search",
"given",
"full",
"text",
"search"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L867-L878 | train |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.callAPIWithResource | @VisibleForTesting
public JSONObject callAPIWithResource(API api, WebResource resource) throws AtlasServiceException {
return callAPIWithResource(toAPIInfo(api), resource, null, JSONObject.class);
} | java | @VisibleForTesting
public JSONObject callAPIWithResource(API api, WebResource resource) throws AtlasServiceException {
return callAPIWithResource(toAPIInfo(api), resource, null, JSONObject.class);
} | [
"@",
"VisibleForTesting",
"public",
"JSONObject",
"callAPIWithResource",
"(",
"API",
"api",
",",
"WebResource",
"resource",
")",
"throws",
"AtlasServiceException",
"{",
"return",
"callAPIWithResource",
"(",
"toAPIInfo",
"(",
"api",
")",
",",
"resource",
",",
"null",... | Wrapper methods for compatibility | [
"Wrapper",
"methods",
"for",
"compatibility"
] | e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L926-L929 | train |
bytefish/PgBulkInsert | PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java | PgBinaryWriter.writeBoolean | public void writeBoolean(boolean value) {
try {
buffer.writeInt(1);
if (value) {
buffer.writeByte(1);
} else {
buffer.writeByte(0);
}
} catch (Exception e) {
throw new BinaryWriteFailedException(e);
}
} | java | public void writeBoolean(boolean value) {
try {
buffer.writeInt(1);
if (value) {
buffer.writeByte(1);
} else {
buffer.writeByte(0);
}
} catch (Exception e) {
throw new BinaryWriteFailedException(e);
}
} | [
"public",
"void",
"writeBoolean",
"(",
"boolean",
"value",
")",
"{",
"try",
"{",
"buffer",
".",
"writeInt",
"(",
"1",
")",
";",
"if",
"(",
"value",
")",
"{",
"buffer",
".",
"writeByte",
"(",
"1",
")",
";",
"}",
"else",
"{",
"buffer",
".",
"writeByt... | Writes primitive boolean to the output stream
@param value value to write | [
"Writes",
"primitive",
"boolean",
"to",
"the",
"output",
"stream"
] | ed3dcdb95a66a38171016dee4a71642ac7cd4a11 | https://github.com/bytefish/PgBulkInsert/blob/ed3dcdb95a66a38171016dee4a71642ac7cd4a11/PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java#L51-L62 | train |
bytefish/PgBulkInsert | PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java | PgBinaryWriter.writeShort | public void writeShort(int value) {
try {
buffer.writeInt(2);
buffer.writeShort(value);
} catch (Exception e) {
throw new BinaryWriteFailedException(e);
}
} | java | public void writeShort(int value) {
try {
buffer.writeInt(2);
buffer.writeShort(value);
} catch (Exception e) {
throw new BinaryWriteFailedException(e);
}
} | [
"public",
"void",
"writeShort",
"(",
"int",
"value",
")",
"{",
"try",
"{",
"buffer",
".",
"writeInt",
"(",
"2",
")",
";",
"buffer",
".",
"writeShort",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"BinaryWrite... | Writes primitive short to the output stream
@param value value to write | [
"Writes",
"primitive",
"short",
"to",
"the",
"output",
"stream"
] | ed3dcdb95a66a38171016dee4a71642ac7cd4a11 | https://github.com/bytefish/PgBulkInsert/blob/ed3dcdb95a66a38171016dee4a71642ac7cd4a11/PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java#L86-L93 | train |
bytefish/PgBulkInsert | PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java | PgBinaryWriter.writeInt | public void writeInt(int value) {
try {
buffer.writeInt(4);
buffer.writeInt(value);
} catch (Exception e) {
throw new BinaryWriteFailedException(e);
}
} | java | public void writeInt(int value) {
try {
buffer.writeInt(4);
buffer.writeInt(value);
} catch (Exception e) {
throw new BinaryWriteFailedException(e);
}
} | [
"public",
"void",
"writeInt",
"(",
"int",
"value",
")",
"{",
"try",
"{",
"buffer",
".",
"writeInt",
"(",
"4",
")",
";",
"buffer",
".",
"writeInt",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"BinaryWriteFail... | Writes primitive integer to the output stream
@param value value to write | [
"Writes",
"primitive",
"integer",
"to",
"the",
"output",
"stream"
] | ed3dcdb95a66a38171016dee4a71642ac7cd4a11 | https://github.com/bytefish/PgBulkInsert/blob/ed3dcdb95a66a38171016dee4a71642ac7cd4a11/PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java#L101-L108 | train |
bytefish/PgBulkInsert | PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java | PgBinaryWriter.writeLong | public void writeLong(long value) {
try {
buffer.writeInt(8);
buffer.writeLong(value);
} catch (Exception e) {
throw new BinaryWriteFailedException(e);
}
} | java | public void writeLong(long value) {
try {
buffer.writeInt(8);
buffer.writeLong(value);
} catch (Exception e) {
throw new BinaryWriteFailedException(e);
}
} | [
"public",
"void",
"writeLong",
"(",
"long",
"value",
")",
"{",
"try",
"{",
"buffer",
".",
"writeInt",
"(",
"8",
")",
";",
"buffer",
".",
"writeLong",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"BinaryWriteF... | Writes primitive long to the output stream
@param value value to write | [
"Writes",
"primitive",
"long",
"to",
"the",
"output",
"stream"
] | ed3dcdb95a66a38171016dee4a71642ac7cd4a11 | https://github.com/bytefish/PgBulkInsert/blob/ed3dcdb95a66a38171016dee4a71642ac7cd4a11/PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java#L116-L123 | train |
bytefish/PgBulkInsert | PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java | PgBinaryWriter.writeFloat | public void writeFloat(float value) {
try {
buffer.writeInt(4);
buffer.writeFloat(value);
} catch (Exception e) {
throw new BinaryWriteFailedException(e);
}
} | java | public void writeFloat(float value) {
try {
buffer.writeInt(4);
buffer.writeFloat(value);
} catch (Exception e) {
throw new BinaryWriteFailedException(e);
}
} | [
"public",
"void",
"writeFloat",
"(",
"float",
"value",
")",
"{",
"try",
"{",
"buffer",
".",
"writeInt",
"(",
"4",
")",
";",
"buffer",
".",
"writeFloat",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"BinaryWri... | Writes primitive float to the output stream
@param value value to write | [
"Writes",
"primitive",
"float",
"to",
"the",
"output",
"stream"
] | ed3dcdb95a66a38171016dee4a71642ac7cd4a11 | https://github.com/bytefish/PgBulkInsert/blob/ed3dcdb95a66a38171016dee4a71642ac7cd4a11/PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java#L131-L138 | train |
bytefish/PgBulkInsert | PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java | PgBinaryWriter.writeDouble | public void writeDouble(double value) {
try {
buffer.writeInt(8);
buffer.writeDouble(value);
} catch (Exception e) {
throw new BinaryWriteFailedException(e);
}
} | java | public void writeDouble(double value) {
try {
buffer.writeInt(8);
buffer.writeDouble(value);
} catch (Exception e) {
throw new BinaryWriteFailedException(e);
}
} | [
"public",
"void",
"writeDouble",
"(",
"double",
"value",
")",
"{",
"try",
"{",
"buffer",
".",
"writeInt",
"(",
"8",
")",
";",
"buffer",
".",
"writeDouble",
"(",
"value",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"Binary... | Writes primitive double to the output stream
@param value value to write | [
"Writes",
"primitive",
"double",
"to",
"the",
"output",
"stream"
] | ed3dcdb95a66a38171016dee4a71642ac7cd4a11 | https://github.com/bytefish/PgBulkInsert/blob/ed3dcdb95a66a38171016dee4a71642ac7cd4a11/PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/PgBinaryWriter.java#L146-L153 | train |
bytefish/PgBulkInsert | PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/utils/TimeStampUtils.java | TimeStampUtils.toPgSecs | @SuppressWarnings("checkstyle:magicnumber")
private static long toPgSecs(final long seconds) {
long secs = seconds;
// java epoc to postgres epoc
secs -= 946684800L;
// Julian/Greagorian calendar cutoff point
if (secs < -13165977600L) { // October 15, 1582 -> October 4, 1582... | java | @SuppressWarnings("checkstyle:magicnumber")
private static long toPgSecs(final long seconds) {
long secs = seconds;
// java epoc to postgres epoc
secs -= 946684800L;
// Julian/Greagorian calendar cutoff point
if (secs < -13165977600L) { // October 15, 1582 -> October 4, 1582... | [
"@",
"SuppressWarnings",
"(",
"\"checkstyle:magicnumber\"",
")",
"private",
"static",
"long",
"toPgSecs",
"(",
"final",
"long",
"seconds",
")",
"{",
"long",
"secs",
"=",
"seconds",
";",
"// java epoc to postgres epoc",
"secs",
"-=",
"946684800L",
";",
"// Julian/Gre... | Converts the given java seconds to postgresql seconds. The conversion is valid for any year 100 BC onwards.
from /org/postgresql/jdbc2/TimestampUtils.java
@param seconds Postgresql seconds.
@return Java seconds. | [
"Converts",
"the",
"given",
"java",
"seconds",
"to",
"postgresql",
"seconds",
".",
"The",
"conversion",
"is",
"valid",
"for",
"any",
"year",
"100",
"BC",
"onwards",
"."
] | ed3dcdb95a66a38171016dee4a71642ac7cd4a11 | https://github.com/bytefish/PgBulkInsert/blob/ed3dcdb95a66a38171016dee4a71642ac7cd4a11/PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/pgsql/utils/TimeStampUtils.java#L85-L103 | train |
bytefish/PgBulkInsert | PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/PgBulkInsert.java | PgBulkInsert.saveAll | public void saveAll(PGConnection connection, Stream<TEntity> entities) throws SQLException {
try (PgBinaryWriter bw = new PgBinaryWriter(configuration.getBufferSize())) {
// Wrap the CopyOutputStream in our own Writer:
bw.open(new PGCopyOutputStream(connection, mapping.getCopyCommand()... | java | public void saveAll(PGConnection connection, Stream<TEntity> entities) throws SQLException {
try (PgBinaryWriter bw = new PgBinaryWriter(configuration.getBufferSize())) {
// Wrap the CopyOutputStream in our own Writer:
bw.open(new PGCopyOutputStream(connection, mapping.getCopyCommand()... | [
"public",
"void",
"saveAll",
"(",
"PGConnection",
"connection",
",",
"Stream",
"<",
"TEntity",
">",
"entities",
")",
"throws",
"SQLException",
"{",
"try",
"(",
"PgBinaryWriter",
"bw",
"=",
"new",
"PgBinaryWriter",
"(",
"configuration",
".",
"getBufferSize",
"(",... | Save stream of entities
@param connection underlying db connection
@param entities stream of entities
@throws SQLException | [
"Save",
"stream",
"of",
"entities"
] | ed3dcdb95a66a38171016dee4a71642ac7cd4a11 | https://github.com/bytefish/PgBulkInsert/blob/ed3dcdb95a66a38171016dee4a71642ac7cd4a11/PgBulkInsert/src/main/java/de/bytefish/pgbulkinsert/PgBulkInsert.java#L44-L54 | train |
grandstaish/paperparcel | paperparcel-compiler/src/main/java/paperparcel/Strings.java | Strings.capitalizeFirstWordAsciiOnly | static String capitalizeFirstWordAsciiOnly(String s) {
if (s == null || s.isEmpty()) {
return s;
}
int secondWordStart = s.length();
for (int i = 1; i < s.length(); i++) {
if (!isLowerCaseAsciiOnly(s.charAt(i))) {
secondWordStart = i;
break;
}
}
return toUpperCa... | java | static String capitalizeFirstWordAsciiOnly(String s) {
if (s == null || s.isEmpty()) {
return s;
}
int secondWordStart = s.length();
for (int i = 1; i < s.length(); i++) {
if (!isLowerCaseAsciiOnly(s.charAt(i))) {
secondWordStart = i;
break;
}
}
return toUpperCa... | [
"static",
"String",
"capitalizeFirstWordAsciiOnly",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"s",
";",
"}",
"int",
"secondWordStart",
"=",
"s",
".",
"length",
"(",
")",
";",
... | "fooBar" -> "FOOBar"
"FooBar" -> "FOOBar"
"foo" -> "FOO" | [
"fooBar",
"-",
">",
"FOOBar",
"FooBar",
"-",
">",
"FOOBar",
"foo",
"-",
">",
"FOO"
] | 917686ced81b335b6708d81d6cc0e3e496f7280d | https://github.com/grandstaish/paperparcel/blob/917686ced81b335b6708d81d6cc0e3e496f7280d/paperparcel-compiler/src/main/java/paperparcel/Strings.java#L42-L54 | train |
grandstaish/paperparcel | paperparcel-compiler/src/main/java/paperparcel/Utils.java | Utils.findLargestPublicConstructor | @Nullable static ExecutableElement findLargestPublicConstructor(TypeElement typeElement) {
List<ExecutableElement> constructors =
FluentIterable.from(ElementFilter.constructorsIn(typeElement.getEnclosedElements()))
.filter(FILTER_NON_PUBLIC)
.toList();
if (constructors.size() ==... | java | @Nullable static ExecutableElement findLargestPublicConstructor(TypeElement typeElement) {
List<ExecutableElement> constructors =
FluentIterable.from(ElementFilter.constructorsIn(typeElement.getEnclosedElements()))
.filter(FILTER_NON_PUBLIC)
.toList();
if (constructors.size() ==... | [
"@",
"Nullable",
"static",
"ExecutableElement",
"findLargestPublicConstructor",
"(",
"TypeElement",
"typeElement",
")",
"{",
"List",
"<",
"ExecutableElement",
">",
"constructors",
"=",
"FluentIterable",
".",
"from",
"(",
"ElementFilter",
".",
"constructorsIn",
"(",
"t... | Returns the public constructor in a given class with the largest number of arguments, or
null if there are no public constructors. | [
"Returns",
"the",
"public",
"constructor",
"in",
"a",
"given",
"class",
"with",
"the",
"largest",
"number",
"of",
"arguments",
"or",
"null",
"if",
"there",
"are",
"no",
"public",
"constructors",
"."
] | 917686ced81b335b6708d81d6cc0e3e496f7280d | https://github.com/grandstaish/paperparcel/blob/917686ced81b335b6708d81d6cc0e3e496f7280d/paperparcel-compiler/src/main/java/paperparcel/Utils.java#L159-L170 | train |
grandstaish/paperparcel | paperparcel-compiler/src/main/java/paperparcel/Utils.java | Utils.isSingleton | static boolean isSingleton(Types types, TypeElement element) {
return isSingleton(types, element, element.asType());
} | java | static boolean isSingleton(Types types, TypeElement element) {
return isSingleton(types, element, element.asType());
} | [
"static",
"boolean",
"isSingleton",
"(",
"Types",
"types",
",",
"TypeElement",
"element",
")",
"{",
"return",
"isSingleton",
"(",
"types",
",",
"element",
",",
"element",
".",
"asType",
"(",
")",
")",
";",
"}"
] | A singleton is defined by a class with a public static final field named "INSTANCE"
with a type assignable from itself. | [
"A",
"singleton",
"is",
"defined",
"by",
"a",
"class",
"with",
"a",
"public",
"static",
"final",
"field",
"named",
"INSTANCE",
"with",
"a",
"type",
"assignable",
"from",
"itself",
"."
] | 917686ced81b335b6708d81d6cc0e3e496f7280d | https://github.com/grandstaish/paperparcel/blob/917686ced81b335b6708d81d6cc0e3e496f7280d/paperparcel-compiler/src/main/java/paperparcel/Utils.java#L334-L336 | train |
grandstaish/paperparcel | paperparcel-compiler/src/main/java/paperparcel/Utils.java | Utils.isParcelable | static boolean isParcelable(Elements elements, Types types, TypeMirror type) {
TypeMirror parcelableType = elements.getTypeElement(PARCELABLE_CLASS_NAME).asType();
return types.isAssignable(type, parcelableType);
} | java | static boolean isParcelable(Elements elements, Types types, TypeMirror type) {
TypeMirror parcelableType = elements.getTypeElement(PARCELABLE_CLASS_NAME).asType();
return types.isAssignable(type, parcelableType);
} | [
"static",
"boolean",
"isParcelable",
"(",
"Elements",
"elements",
",",
"Types",
"types",
",",
"TypeMirror",
"type",
")",
"{",
"TypeMirror",
"parcelableType",
"=",
"elements",
".",
"getTypeElement",
"(",
"PARCELABLE_CLASS_NAME",
")",
".",
"asType",
"(",
")",
";",... | Returns true if a type implements Parcelable | [
"Returns",
"true",
"if",
"a",
"type",
"implements",
"Parcelable"
] | 917686ced81b335b6708d81d6cc0e3e496f7280d | https://github.com/grandstaish/paperparcel/blob/917686ced81b335b6708d81d6cc0e3e496f7280d/paperparcel-compiler/src/main/java/paperparcel/Utils.java#L440-L443 | train |
grandstaish/paperparcel | paperparcel-compiler/src/main/java/paperparcel/Utils.java | Utils.getAnnotationWithSimpleName | @Nullable static AnnotationMirror getAnnotationWithSimpleName(Element element, String name) {
for (AnnotationMirror mirror : element.getAnnotationMirrors()) {
String annotationName = mirror.getAnnotationType().asElement().getSimpleName().toString();
if (name.equals(annotationName)) {
return mirr... | java | @Nullable static AnnotationMirror getAnnotationWithSimpleName(Element element, String name) {
for (AnnotationMirror mirror : element.getAnnotationMirrors()) {
String annotationName = mirror.getAnnotationType().asElement().getSimpleName().toString();
if (name.equals(annotationName)) {
return mirr... | [
"@",
"Nullable",
"static",
"AnnotationMirror",
"getAnnotationWithSimpleName",
"(",
"Element",
"element",
",",
"String",
"name",
")",
"{",
"for",
"(",
"AnnotationMirror",
"mirror",
":",
"element",
".",
"getAnnotationMirrors",
"(",
")",
")",
"{",
"String",
"annotati... | Finds an annotation with the given name on the given element, or null if not found. | [
"Finds",
"an",
"annotation",
"with",
"the",
"given",
"name",
"on",
"the",
"given",
"element",
"or",
"null",
"if",
"not",
"found",
"."
] | 917686ced81b335b6708d81d6cc0e3e496f7280d | https://github.com/grandstaish/paperparcel/blob/917686ced81b335b6708d81d6cc0e3e496f7280d/paperparcel-compiler/src/main/java/paperparcel/Utils.java#L684-L692 | train |
ACINQ/bitcoin-lib | src/main/java/fr/acinq/Secp256k1Loader.java | Secp256k1Loader.extractAndLoadLibraryFile | private static boolean extractAndLoadLibraryFile(String libFolderForCurrentOS, String libraryFileName,
String targetFolder) {
String nativeLibraryFilePath = libFolderForCurrentOS + "/" + libraryFileName;
// Include architecture name in temporary filen... | java | private static boolean extractAndLoadLibraryFile(String libFolderForCurrentOS, String libraryFileName,
String targetFolder) {
String nativeLibraryFilePath = libFolderForCurrentOS + "/" + libraryFileName;
// Include architecture name in temporary filen... | [
"private",
"static",
"boolean",
"extractAndLoadLibraryFile",
"(",
"String",
"libFolderForCurrentOS",
",",
"String",
"libraryFileName",
",",
"String",
"targetFolder",
")",
"{",
"String",
"nativeLibraryFilePath",
"=",
"libFolderForCurrentOS",
"+",
"\"/\"",
"+",
"libraryFile... | Extracts and loads the specified library file to the target folder
@param libFolderForCurrentOS Library path.
@param libraryFileName Library name.
@param targetFolder Target folder.
@return | [
"Extracts",
"and",
"loads",
"the",
"specified",
"library",
"file",
"to",
"the",
"target",
"folder"
] | 74a30b28b1001672359b19890ffa3d3951362d65 | https://github.com/ACINQ/bitcoin-lib/blob/74a30b28b1001672359b19890ffa3d3951362d65/src/main/java/fr/acinq/Secp256k1Loader.java#L125-L195 | train |
ACINQ/bitcoin-lib | src/main/java/fr/acinq/Secp256k1Loader.java | Secp256k1Loader.loadNativeLibrary | private static boolean loadNativeLibrary(String path, String name) {
File libPath = new File(path, name);
if(libPath.exists()) {
try {
System.load(new File(path, name).getAbsolutePath());
return true;
}
catch(UnsatisfiedLinkError e) {
... | java | private static boolean loadNativeLibrary(String path, String name) {
File libPath = new File(path, name);
if(libPath.exists()) {
try {
System.load(new File(path, name).getAbsolutePath());
return true;
}
catch(UnsatisfiedLinkError e) {
... | [
"private",
"static",
"boolean",
"loadNativeLibrary",
"(",
"String",
"path",
",",
"String",
"name",
")",
"{",
"File",
"libPath",
"=",
"new",
"File",
"(",
"path",
",",
"name",
")",
";",
"if",
"(",
"libPath",
".",
"exists",
"(",
")",
")",
"{",
"try",
"{... | Loads native library using the given path and name of the library.
@param path Path of the native library.
@param name Name of the native library.
@return True for successfully loading; false otherwise. | [
"Loads",
"native",
"library",
"using",
"the",
"given",
"path",
"and",
"name",
"of",
"the",
"library",
"."
] | 74a30b28b1001672359b19890ffa3d3951362d65 | https://github.com/ACINQ/bitcoin-lib/blob/74a30b28b1001672359b19890ffa3d3951362d65/src/main/java/fr/acinq/Secp256k1Loader.java#L204-L222 | train |
ACINQ/bitcoin-lib | src/main/java/fr/acinq/Secp256k1Loader.java | Secp256k1Loader.loadSecp256k1NativeLibrary | private static void loadSecp256k1NativeLibrary() throws Exception {
if(extracted) {
return;
}
// Try loading library from fr.acinq.secp256k1.lib.path library path */
String secp256k1NativeLibraryPath = System.getProperty("fr.acinq.secp256k1.lib.path");
String secp256... | java | private static void loadSecp256k1NativeLibrary() throws Exception {
if(extracted) {
return;
}
// Try loading library from fr.acinq.secp256k1.lib.path library path */
String secp256k1NativeLibraryPath = System.getProperty("fr.acinq.secp256k1.lib.path");
String secp256... | [
"private",
"static",
"void",
"loadSecp256k1NativeLibrary",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"extracted",
")",
"{",
"return",
";",
"}",
"// Try loading library from fr.acinq.secp256k1.lib.path library path */",
"String",
"secp256k1NativeLibraryPath",
"=",
"Sy... | Loads secp256k1 native library using given path and name of the library.
@throws | [
"Loads",
"secp256k1",
"native",
"library",
"using",
"given",
"path",
"and",
"name",
"of",
"the",
"library",
"."
] | 74a30b28b1001672359b19890ffa3d3951362d65 | https://github.com/ACINQ/bitcoin-lib/blob/74a30b28b1001672359b19890ffa3d3951362d65/src/main/java/fr/acinq/Secp256k1Loader.java#L229-L283 | train |
otto-de/edison-microservice | edison-core/src/main/java/de/otto/edison/util/UrlHelper.java | UrlHelper.absoluteHrefOf | public static String absoluteHrefOf(final String path) {
try {
return fromCurrentServletMapping().path(path).build().toString();
} catch (final IllegalStateException e) {
return path;
}
} | java | public static String absoluteHrefOf(final String path) {
try {
return fromCurrentServletMapping().path(path).build().toString();
} catch (final IllegalStateException e) {
return path;
}
} | [
"public",
"static",
"String",
"absoluteHrefOf",
"(",
"final",
"String",
"path",
")",
"{",
"try",
"{",
"return",
"fromCurrentServletMapping",
"(",
")",
".",
"path",
"(",
"path",
")",
".",
"build",
"(",
")",
".",
"toString",
"(",
")",
";",
"}",
"catch",
... | Returns an absolute URL for the specified path.
Example: If the current request URL is http://example.org/helloworld/internal/status,
{@code absoluteHrefOf("/internal/health")} will return http://example.org/helloworld/internal/health (with
helloworld as servletContextPath).
This method relies on Spring's {@link org.... | [
"Returns",
"an",
"absolute",
"URL",
"for",
"the",
"specified",
"path",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-core/src/main/java/de/otto/edison/util/UrlHelper.java#L43-L49 | train |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/repository/mongo/MongoJobMetaRepository.java | MongoJobMetaRepository.disable | @Override
public void disable(final String jobType, final String comment) {
setValue(jobType, KEY_DISABLED, comment != null ? comment : "");
} | java | @Override
public void disable(final String jobType, final String comment) {
setValue(jobType, KEY_DISABLED, comment != null ? comment : "");
} | [
"@",
"Override",
"public",
"void",
"disable",
"(",
"final",
"String",
"jobType",
",",
"final",
"String",
"comment",
")",
"{",
"setValue",
"(",
"jobType",
",",
"KEY_DISABLED",
",",
"comment",
"!=",
"null",
"?",
"comment",
":",
"\"\"",
")",
";",
"}"
] | Disables a job type, i.e. prevents it from being started
@param jobType the disabled job type
@param comment an optional comment | [
"Disables",
"a",
"job",
"type",
"i",
".",
"e",
".",
"prevents",
"it",
"from",
"being",
"started"
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/repository/mongo/MongoJobMetaRepository.java#L104-L107 | train |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/repository/mongo/MongoJobMetaRepository.java | MongoJobMetaRepository.findAllJobTypes | @Override
public Set<String> findAllJobTypes() {
return stream(collection.find().maxTime(500, TimeUnit.MILLISECONDS).spliterator(), false)
.map(doc -> doc.getString(ID))
.collect(toSet());
} | java | @Override
public Set<String> findAllJobTypes() {
return stream(collection.find().maxTime(500, TimeUnit.MILLISECONDS).spliterator(), false)
.map(doc -> doc.getString(ID))
.collect(toSet());
} | [
"@",
"Override",
"public",
"Set",
"<",
"String",
">",
"findAllJobTypes",
"(",
")",
"{",
"return",
"stream",
"(",
"collection",
".",
"find",
"(",
")",
".",
"maxTime",
"(",
"500",
",",
"TimeUnit",
".",
"MILLISECONDS",
")",
".",
"spliterator",
"(",
")",
"... | Returns all job types having state information.
@return set containing job types. | [
"Returns",
"all",
"job",
"types",
"having",
"state",
"information",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/repository/mongo/MongoJobMetaRepository.java#L166-L171 | train |
otto-de/edison-microservice | edison-mongo/src/main/java/de/otto/edison/mongo/AbstractMongoRepository.java | AbstractMongoRepository.update | public boolean update(final V value, final long maxTime, final TimeUnit timeUnit) {
final K key = keyOf(value);
if (key != null) {
return collectionWithWriteTimeout(maxTime, timeUnit)
.replaceOne(byId(key), encode(value))
.getModifiedCount() == 1;
... | java | public boolean update(final V value, final long maxTime, final TimeUnit timeUnit) {
final K key = keyOf(value);
if (key != null) {
return collectionWithWriteTimeout(maxTime, timeUnit)
.replaceOne(byId(key), encode(value))
.getModifiedCount() == 1;
... | [
"public",
"boolean",
"update",
"(",
"final",
"V",
"value",
",",
"final",
"long",
"maxTime",
",",
"final",
"TimeUnit",
"timeUnit",
")",
"{",
"final",
"K",
"key",
"=",
"keyOf",
"(",
"value",
")",
";",
"if",
"(",
"key",
"!=",
"null",
")",
"{",
"return",... | Updates the document if it is already present in the repository.
@param value the new value
@param maxTime max time for the update
@param timeUnit the time unit for the maxTime value
@return true, if the document was updated, false otherwise. | [
"Updates",
"the",
"document",
"if",
"it",
"is",
"already",
"present",
"in",
"the",
"repository",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-mongo/src/main/java/de/otto/edison/mongo/AbstractMongoRepository.java#L208-L217 | train |
otto-de/edison-microservice | edison-mongo/src/main/java/de/otto/edison/mongo/AbstractMongoRepository.java | AbstractMongoRepository.delete | public void delete(final K key, final long maxTime, final TimeUnit timeUnit) {
collectionWithWriteTimeout(maxTime, timeUnit).deleteOne(byId(key));
} | java | public void delete(final K key, final long maxTime, final TimeUnit timeUnit) {
collectionWithWriteTimeout(maxTime, timeUnit).deleteOne(byId(key));
} | [
"public",
"void",
"delete",
"(",
"final",
"K",
"key",
",",
"final",
"long",
"maxTime",
",",
"final",
"TimeUnit",
"timeUnit",
")",
"{",
"collectionWithWriteTimeout",
"(",
"maxTime",
",",
"timeUnit",
")",
".",
"deleteOne",
"(",
"byId",
"(",
"key",
")",
")",
... | Deletes the document identified by key.
@param key the identifier of the deleted document
@param maxTime max time for the operation
@param timeUnit the time unit for the maxTime value | [
"Deletes",
"the",
"document",
"identified",
"by",
"key",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-mongo/src/main/java/de/otto/edison/mongo/AbstractMongoRepository.java#L296-L298 | train |
otto-de/edison-microservice | edison-mongo/src/main/java/de/otto/edison/mongo/AbstractMongoRepository.java | AbstractMongoRepository.byId | protected Document byId(final K key) {
if (key != null) {
return new Document(ID, key.toString());
} else {
throw new NullPointerException("Key must not be null");
}
} | java | protected Document byId(final K key) {
if (key != null) {
return new Document(ID, key.toString());
} else {
throw new NullPointerException("Key must not be null");
}
} | [
"protected",
"Document",
"byId",
"(",
"final",
"K",
"key",
")",
"{",
"if",
"(",
"key",
"!=",
"null",
")",
"{",
"return",
"new",
"Document",
"(",
"ID",
",",
"key",
".",
"toString",
"(",
")",
")",
";",
"}",
"else",
"{",
"throw",
"new",
"NullPointerEx... | Returns a query that is selecting documents by ID.
@param key the document's key
@return query Document | [
"Returns",
"a",
"query",
"that",
"is",
"selecting",
"documents",
"by",
"ID",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-mongo/src/main/java/de/otto/edison/mongo/AbstractMongoRepository.java#L323-L329 | train |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/repository/inmem/InMemJobMetaRepository.java | InMemJobMetaRepository.getJobMeta | @Override
public JobMeta getJobMeta(String jobType) {
final Map<String, String> document = map.get(jobType);
if (document != null) {
final Map<String, String> meta = document.keySet()
.stream()
.filter(key -> !key.startsWith("_e_"))
... | java | @Override
public JobMeta getJobMeta(String jobType) {
final Map<String, String> document = map.get(jobType);
if (document != null) {
final Map<String, String> meta = document.keySet()
.stream()
.filter(key -> !key.startsWith("_e_"))
... | [
"@",
"Override",
"public",
"JobMeta",
"getJobMeta",
"(",
"String",
"jobType",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"document",
"=",
"map",
".",
"get",
"(",
"jobType",
")",
";",
"if",
"(",
"document",
"!=",
"null",
")",
"{",
"f... | Returns the current state of the specified job type.
@param jobType the job type
@return current state of the job type | [
"Returns",
"the",
"current",
"state",
"of",
"the",
"specified",
"job",
"type",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/repository/inmem/InMemJobMetaRepository.java#L100-L118 | train |
otto-de/edison-microservice | edison-core/src/main/java/de/otto/edison/status/domain/ServiceType.java | ServiceType.serviceType | public static ServiceType serviceType(final String type, final Criticality criticality, final String disasterImpact) {
return new ServiceType(type, criticality, disasterImpact);
} | java | public static ServiceType serviceType(final String type, final Criticality criticality, final String disasterImpact) {
return new ServiceType(type, criticality, disasterImpact);
} | [
"public",
"static",
"ServiceType",
"serviceType",
"(",
"final",
"String",
"type",
",",
"final",
"Criticality",
"criticality",
",",
"final",
"String",
"disasterImpact",
")",
"{",
"return",
"new",
"ServiceType",
"(",
"type",
",",
"criticality",
",",
"disasterImpact"... | Creates a ServiceType.
@param type The type of the service dependency.
@param criticality The criticality of the required service for the operation of this service.
@param disasterImpact Short description of the impact of outages: what would happen if the system is not operational?
@return ServiceType | [
"Creates",
"a",
"ServiceType",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-core/src/main/java/de/otto/edison/status/domain/ServiceType.java#L35-L37 | train |
otto-de/edison-microservice | edison-core/src/main/java/de/otto/edison/configuration/EdisonApplicationProperties.java | EdisonApplicationProperties.edisonApplicationProperties | public static EdisonApplicationProperties edisonApplicationProperties(final String title,
final String group,
final String environment,
... | java | public static EdisonApplicationProperties edisonApplicationProperties(final String title,
final String group,
final String environment,
... | [
"public",
"static",
"EdisonApplicationProperties",
"edisonApplicationProperties",
"(",
"final",
"String",
"title",
",",
"final",
"String",
"group",
",",
"final",
"String",
"environment",
",",
"final",
"String",
"description",
")",
"{",
"final",
"EdisonApplicationPropert... | Only used in tests.
@param title Human-readable title of the application
@param group Application group
@param environment Environment / stage of the application
@param description Human-readable description of the application
@return StatusProperties | [
"Only",
"used",
"in",
"tests",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-core/src/main/java/de/otto/edison/configuration/EdisonApplicationProperties.java#L39-L50 | train |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/status/JobStatusCalculator.java | JobStatusCalculator.statusDetail | public StatusDetail statusDetail(final JobDefinition jobDefinition) {
try {
final List<JobInfo> jobs = jobRepository.findLatestBy(jobDefinition.jobType(), numberOfJobs + 1);
return jobs.isEmpty()
? statusDetailWhenNoJobAvailable(jobDefinition)
: to... | java | public StatusDetail statusDetail(final JobDefinition jobDefinition) {
try {
final List<JobInfo> jobs = jobRepository.findLatestBy(jobDefinition.jobType(), numberOfJobs + 1);
return jobs.isEmpty()
? statusDetailWhenNoJobAvailable(jobDefinition)
: to... | [
"public",
"StatusDetail",
"statusDetail",
"(",
"final",
"JobDefinition",
"jobDefinition",
")",
"{",
"try",
"{",
"final",
"List",
"<",
"JobInfo",
">",
"jobs",
"=",
"jobRepository",
".",
"findLatestBy",
"(",
"jobDefinition",
".",
"jobType",
"(",
")",
",",
"numbe... | Returns a StatusDetail for a JobDefinition. The Status of the StatusDetail is calculated using
the last job executions and depends on the configuration of the calculator.
@param jobDefinition definition of the job to calculate.
@return StatusDetail of job executions of the {@link JobDefinition#jobType()} | [
"Returns",
"a",
"StatusDetail",
"for",
"a",
"JobDefinition",
".",
"The",
"Status",
"of",
"the",
"StatusDetail",
"is",
"calculated",
"using",
"the",
"last",
"job",
"executions",
"and",
"depends",
"on",
"the",
"configuration",
"of",
"the",
"calculator",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/status/JobStatusCalculator.java#L200-L210 | train |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/status/JobStatusCalculator.java | JobStatusCalculator.toStatusDetail | protected StatusDetail toStatusDetail(final List<JobInfo> jobInfos,
final JobDefinition jobDefinition) {
final Status status;
final String message;
final JobInfo currentJob = jobInfos.get(0);
final JobInfo lastJob = (!currentJob.getStopped().isPr... | java | protected StatusDetail toStatusDetail(final List<JobInfo> jobInfos,
final JobDefinition jobDefinition) {
final Status status;
final String message;
final JobInfo currentJob = jobInfos.get(0);
final JobInfo lastJob = (!currentJob.getStopped().isPr... | [
"protected",
"StatusDetail",
"toStatusDetail",
"(",
"final",
"List",
"<",
"JobInfo",
">",
"jobInfos",
",",
"final",
"JobDefinition",
"jobDefinition",
")",
"{",
"final",
"Status",
"status",
";",
"final",
"String",
"message",
";",
"final",
"JobInfo",
"currentJob",
... | Calculates the StatusDetail from the last job executions.
@param jobInfos one or more JobInfo
@param jobDefinition definition of the last job
@return StatusDetail to indicate for the given last job | [
"Calculates",
"the",
"StatusDetail",
"from",
"the",
"last",
"job",
"executions",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/status/JobStatusCalculator.java#L223-L277 | train |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/status/JobStatusCalculator.java | JobStatusCalculator.getNumFailedJobs | protected final long getNumFailedJobs(final List<JobInfo> jobInfos) {
return jobInfos
.stream()
.filter(job -> JobStatus.ERROR.equals(job.getStatus()))
.count();
} | java | protected final long getNumFailedJobs(final List<JobInfo> jobInfos) {
return jobInfos
.stream()
.filter(job -> JobStatus.ERROR.equals(job.getStatus()))
.count();
} | [
"protected",
"final",
"long",
"getNumFailedJobs",
"(",
"final",
"List",
"<",
"JobInfo",
">",
"jobInfos",
")",
"{",
"return",
"jobInfos",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"job",
"->",
"JobStatus",
".",
"ERROR",
".",
"equals",
"(",
"job",
".",
... | Returns the number of failed jobs.
@param jobInfos list of job infos
@return num failed jobs | [
"Returns",
"the",
"number",
"of",
"failed",
"jobs",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/status/JobStatusCalculator.java#L285-L290 | train |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/status/JobStatusCalculator.java | JobStatusCalculator.runningDetailsFor | protected Map<String, String> runningDetailsFor(final JobInfo jobInfo) {
final Map<String, String> details = new HashMap<>();
details.put("Started", ISO_DATE_TIME.format(jobInfo.getStarted()));
if (jobInfo.getStopped().isPresent()) {
details.put("Stopped", ISO_DATE_TIME.format(jobInf... | java | protected Map<String, String> runningDetailsFor(final JobInfo jobInfo) {
final Map<String, String> details = new HashMap<>();
details.put("Started", ISO_DATE_TIME.format(jobInfo.getStarted()));
if (jobInfo.getStopped().isPresent()) {
details.put("Stopped", ISO_DATE_TIME.format(jobInf... | [
"protected",
"Map",
"<",
"String",
",",
"String",
">",
"runningDetailsFor",
"(",
"final",
"JobInfo",
"jobInfo",
")",
"{",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"details",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"details",
".",
"put",
"... | Returns additional information like job uri, running state, started and stopped timestamps.
@param jobInfo the job information of the last job
@return map containing uri, starting, and running or stopped entries. | [
"Returns",
"additional",
"information",
"like",
"job",
"uri",
"running",
"state",
"started",
"and",
"stopped",
"timestamps",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/status/JobStatusCalculator.java#L298-L305 | train |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/status/JobStatusCalculator.java | JobStatusCalculator.jobTooOld | protected boolean jobTooOld(final JobInfo jobInfo, final JobDefinition jobDefinition) {
final Optional<OffsetDateTime> stopped = jobInfo.getStopped();
if (stopped.isPresent() && jobDefinition.maxAge().isPresent()) {
final OffsetDateTime deadlineToRerun = stopped.get().plus(jobDefinition.maxA... | java | protected boolean jobTooOld(final JobInfo jobInfo, final JobDefinition jobDefinition) {
final Optional<OffsetDateTime> stopped = jobInfo.getStopped();
if (stopped.isPresent() && jobDefinition.maxAge().isPresent()) {
final OffsetDateTime deadlineToRerun = stopped.get().plus(jobDefinition.maxA... | [
"protected",
"boolean",
"jobTooOld",
"(",
"final",
"JobInfo",
"jobInfo",
",",
"final",
"JobDefinition",
"jobDefinition",
")",
"{",
"final",
"Optional",
"<",
"OffsetDateTime",
">",
"stopped",
"=",
"jobInfo",
".",
"getStopped",
"(",
")",
";",
"if",
"(",
"stopped... | Calculates whether or not the last job execution is too old.
@param jobInfo job info of the last job execution
@param jobDefinition job definition, specifying the max age of jobs
@return boolean | [
"Calculates",
"whether",
"or",
"not",
"the",
"last",
"job",
"execution",
"is",
"too",
"old",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/status/JobStatusCalculator.java#L314-L322 | train |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/repository/cleanup/DeleteSkippedJobs.java | DeleteSkippedJobs.doCleanUp | @Scheduled(fixedRate = KEEP_LAST_JOBS_CLEANUP_INTERVAL)
public void doCleanUp() {
final List<JobInfo> jobs = jobRepository.findAllJobInfoWithoutMessages();
findJobsToDelete(jobs)
.forEach(jobInfo -> jobRepository.removeIfStopped(jobInfo.getJobId()));
} | java | @Scheduled(fixedRate = KEEP_LAST_JOBS_CLEANUP_INTERVAL)
public void doCleanUp() {
final List<JobInfo> jobs = jobRepository.findAllJobInfoWithoutMessages();
findJobsToDelete(jobs)
.forEach(jobInfo -> jobRepository.removeIfStopped(jobInfo.getJobId()));
} | [
"@",
"Scheduled",
"(",
"fixedRate",
"=",
"KEEP_LAST_JOBS_CLEANUP_INTERVAL",
")",
"public",
"void",
"doCleanUp",
"(",
")",
"{",
"final",
"List",
"<",
"JobInfo",
">",
"jobs",
"=",
"jobRepository",
".",
"findAllJobInfoWithoutMessages",
"(",
")",
";",
"findJobsToDelet... | Execute the cleanup of the given repository. | [
"Execute",
"the",
"cleanup",
"of",
"the",
"given",
"repository",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/repository/cleanup/DeleteSkippedJobs.java#L46-L52 | train |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/service/JobDefinitionService.java | JobDefinitionService.getJobDefinition | public Optional<JobDefinition> getJobDefinition(final String jobType) {
return jobDefinitions
.stream()
.filter((j) -> j.jobType().equalsIgnoreCase(jobType))
.findAny();
} | java | public Optional<JobDefinition> getJobDefinition(final String jobType) {
return jobDefinitions
.stream()
.filter((j) -> j.jobType().equalsIgnoreCase(jobType))
.findAny();
} | [
"public",
"Optional",
"<",
"JobDefinition",
">",
"getJobDefinition",
"(",
"final",
"String",
"jobType",
")",
"{",
"return",
"jobDefinitions",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"(",
"j",
")",
"-",
">",
"j",
".",
"jobType",
"(",
")",
".",
"equ... | Returns an optional JobDefinition matching the given jobType.
@param jobType case insensitive {@link JobDefinition#jobType() job type}
@return optional JobDefinition | [
"Returns",
"an",
"optional",
"JobDefinition",
"matching",
"the",
"given",
"jobType",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/service/JobDefinitionService.java#L69-L74 | train |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/service/JobService.java | JobService.startAsyncJob | public Optional<String> startAsyncJob(String jobType) {
try {
final JobRunnable jobRunnable = findJobRunnable(jobType);
final JobInfo jobInfo = createJobInfo(jobType);
jobMetaService.aquireRunLock(jobInfo.getJobId(), jobInfo.getJobType());
jobRepository.createOrUp... | java | public Optional<String> startAsyncJob(String jobType) {
try {
final JobRunnable jobRunnable = findJobRunnable(jobType);
final JobInfo jobInfo = createJobInfo(jobType);
jobMetaService.aquireRunLock(jobInfo.getJobId(), jobInfo.getJobType());
jobRepository.createOrUp... | [
"public",
"Optional",
"<",
"String",
">",
"startAsyncJob",
"(",
"String",
"jobType",
")",
"{",
"try",
"{",
"final",
"JobRunnable",
"jobRunnable",
"=",
"findJobRunnable",
"(",
"jobType",
")",
";",
"final",
"JobInfo",
"jobInfo",
"=",
"createJobInfo",
"(",
"jobTy... | Starts a job asynchronously in the background.
@param jobType the type of the job
@return the URI under which you can retrieve the status about the triggered job instance | [
"Starts",
"a",
"job",
"asynchronously",
"in",
"the",
"background",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/service/JobService.java#L100-L111 | train |
otto-de/edison-microservice | edison-jobs/src/main/java/de/otto/edison/jobs/service/JobService.java | JobService.findJobs | public List<JobInfo> findJobs(final Optional<String> type, final int count) {
if (type.isPresent()) {
return jobRepository.findLatestBy(type.get(), count);
} else {
return jobRepository.findLatest(count);
}
} | java | public List<JobInfo> findJobs(final Optional<String> type, final int count) {
if (type.isPresent()) {
return jobRepository.findLatestBy(type.get(), count);
} else {
return jobRepository.findLatest(count);
}
} | [
"public",
"List",
"<",
"JobInfo",
">",
"findJobs",
"(",
"final",
"Optional",
"<",
"String",
">",
"type",
",",
"final",
"int",
"count",
")",
"{",
"if",
"(",
"type",
".",
"isPresent",
"(",
")",
")",
"{",
"return",
"jobRepository",
".",
"findLatestBy",
"(... | Find the latest jobs, optionally restricted to jobs of a specified type.
@param type if provided, the last N jobs of the type are returned, otherwise the last jobs of any type.
@param count the number of jobs to return.
@return a list of JobInfos | [
"Find",
"the",
"latest",
"jobs",
"optionally",
"restricted",
"to",
"jobs",
"of",
"a",
"specified",
"type",
"."
] | 89ecf0a0dee40977f004370b0b474a36c699e8a2 | https://github.com/otto-de/edison-microservice/blob/89ecf0a0dee40977f004370b0b474a36c699e8a2/edison-jobs/src/main/java/de/otto/edison/jobs/service/JobService.java#L124-L130 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.