Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
atlas
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dataplatform
atlas
Commits
c4fc5b4f
Commit
c4fc5b4f
authored
8 years ago
by
Suma Shivaprasad
Committed by
Madhan Neethiraj
8 years ago
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-1744: updated to address review comments and ATLAS startup failure
Signed-off-by:
Madhan Neethiraj
<
madhan@apache.org
>
parent
ca64ef4e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
6 deletions
+11
-6
AtlasAbstractDefStoreV1.java
...as/repository/store/graph/v1/AtlasAbstractDefStoreV1.java
+6
-2
QueryParser.scala
...y/src/main/scala/org/apache/atlas/query/QueryParser.scala
+0
-3
AtlasEntityDefStoreV1Test.java
...las/repository/store/graph/AtlasEntityDefStoreV1Test.java
+5
-1
No files found.
repository/src/main/java/org/apache/atlas/repository/store/graph/v1/AtlasAbstractDefStoreV1.java
View file @
c4fc5b4f
...
...
@@ -25,6 +25,8 @@ import org.apache.atlas.model.typedef.AtlasBaseTypeDef;
import
org.apache.atlas.model.typedef.AtlasStructDef
;
import
org.apache.atlas.query.QueryParser
;
import
org.apache.atlas.type.AtlasTypeRegistry
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
java.util.List
;
import
java.util.regex.Matcher
;
...
...
@@ -34,13 +36,14 @@ import java.util.regex.Pattern;
* Abstract typedef-store for v1 format.
*/
public
abstract
class
AtlasAbstractDefStoreV1
{
private
static
final
Logger
LOG
=
LoggerFactory
.
getLogger
(
AtlasAbstractDefStoreV1
.
class
);
protected
final
AtlasTypeDefGraphStoreV1
typeDefStore
;
protected
final
AtlasTypeRegistry
typeRegistry
;
private
static
final
String
NAME_REGEX
=
"[a-zA-Z][a-zA-Z0-9_ ]*"
;
private
static
final
Pattern
NAME_PATTERN
=
Pattern
.
compile
(
NAME_REGEX
);
p
rivate
static
final
String
ALLOW_RESERVED_KEYWORDS
=
"atlas.types.allowReservedKeywords"
;
p
ublic
static
final
String
ALLOW_RESERVED_KEYWORDS
=
"atlas.types.allowReservedKeywords"
;
public
AtlasAbstractDefStoreV1
(
AtlasTypeDefGraphStoreV1
typeDefStore
,
AtlasTypeRegistry
typeRegistry
)
{
this
.
typeDefStore
=
typeDefStore
;
...
...
@@ -53,7 +56,7 @@ public abstract class AtlasAbstractDefStoreV1 {
}
try
{
final
boolean
allowReservedKeywords
=
ApplicationProperties
.
get
().
getBoolean
(
ALLOW_RESERVED_KEYWORDS
,
fals
e
);
final
boolean
allowReservedKeywords
=
ApplicationProperties
.
get
().
getBoolean
(
ALLOW_RESERVED_KEYWORDS
,
tru
e
);
if
(!
allowReservedKeywords
&&
typeDef
instanceof
AtlasStructDef
)
{
final
List
<
AtlasStructDef
.
AtlasAttributeDef
>
attributeDefs
=
((
AtlasStructDef
)
typeDef
).
getAttributeDefs
();
...
...
@@ -64,6 +67,7 @@ public abstract class AtlasAbstractDefStoreV1 {
}
}
}
catch
(
AtlasException
e
)
{
LOG
.
error
(
"Exception while loading configuration "
,
e
);
throw
new
AtlasBaseException
(
AtlasErrorCode
.
INTERNAL_ERROR
,
"Could not load configuration"
);
}
}
...
...
This diff is collapsed.
Click to expand it.
repository/src/main/scala/org/apache/atlas/query/QueryParser.scala
View file @
c4fc5b4f
...
...
@@ -422,9 +422,6 @@ object QueryParser extends StandardTokenParsers with QueryKeywords with Expressi
}
def
isKeyword
(
s
:
String
)
=
queryreservedWords
.
contains
(
s
)
def
isDelimiter
(
s
:
String
)
=
querydelims
.
contains
(
s
)
}
class
QueryLexer
(
val
keywords
:
Seq
[
String
],
val
delims
:
Seq
[
String
])
extends
StdLexical
with
ImplicitConversions
{
...
...
This diff is collapsed.
Click to expand it.
repository/src/test/java/org/apache/atlas/repository/store/graph/AtlasEntityDefStoreV1Test.java
View file @
c4fc5b4f
...
...
@@ -19,11 +19,14 @@ package org.apache.atlas.repository.store.graph;
import
com.google.common.collect.ImmutableSet
;
import
com.google.inject.Inject
;
import
org.apache.atlas.ApplicationProperties
;
import
org.apache.atlas.AtlasErrorCode
;
import
org.apache.atlas.AtlasException
;
import
org.apache.atlas.RepositoryMetadataModule
;
import
org.apache.atlas.exception.AtlasBaseException
;
import
org.apache.atlas.model.typedef.AtlasEntityDef
;
import
org.apache.atlas.repository.graph.AtlasGraphProvider
;
import
org.apache.atlas.repository.store.graph.v1.AtlasAbstractDefStoreV1
;
import
org.apache.atlas.type.AtlasTypeUtil
;
import
org.testng.Assert
;
import
org.testng.annotations.AfterClass
;
...
...
@@ -58,8 +61,9 @@ public class AtlasEntityDefStoreV1Test {
}
@Test
(
dataProvider
=
"invalidAttributeNameWithReservedKeywords"
)
public
void
testCreateTypeWithReservedKeywords
(
AtlasEntityDef
atlasEntityDef
)
{
public
void
testCreateTypeWithReservedKeywords
(
AtlasEntityDef
atlasEntityDef
)
throws
AtlasException
{
try
{
ApplicationProperties
.
get
().
setProperty
(
AtlasAbstractDefStoreV1
.
ALLOW_RESERVED_KEYWORDS
,
false
);
entityDefStore
.
create
(
atlasEntityDef
,
null
);
}
catch
(
AtlasBaseException
e
)
{
Assert
.
assertEquals
(
e
.
getAtlasErrorCode
(),
AtlasErrorCode
.
ATTRIBUTE_NAME_INVALID
);
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment