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
d2b9b99f
Commit
d2b9b99f
authored
Feb 02, 2016
by
Shwetha GS
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ATLAS-452 Exceptions while running HiveHookIT#testAlterTableRename (shwethags)
parent
6ec94374
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
49 additions
and
5 deletions
+49
-5
release-log.txt
release-log.txt
+1
-0
GraphHelper.java
...n/java/org/apache/atlas/repository/graph/GraphHelper.java
+4
-2
TypesResource.java
...in/java/org/apache/atlas/web/resources/TypesResource.java
+1
-1
Servlets.java
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java
+3
-2
ServletsTest.java
...src/test/java/org/apache/atlas/web/util/ServletsTest.java
+40
-0
No files found.
release-log.txt
View file @
d2b9b99f
...
...
@@ -7,6 +7,7 @@ ATLAS-409 Atlas will not import avro tables with schema read from a file (dosset
ATLAS-379 Create sqoop and falcon metadata addons (venkatnrangan,bvellanki,sowmyaramesh via shwethags)
ALL CHANGES:
ATLAS-452 Exceptions while running HiveHookIT#testAlterTableRename (shwethags)
ATLAS-388 UI : On creating Tag, the page to be reset for creating new Tag (Anilg via shwethags)
ATLAS-199 webapp build fails (grunt + tests) (sanjayp via shwethags)
ATLAS-415 Hive import fails when importing a table that is already imported without StorageDescriptor information (yhemanth via shwethags)
...
...
repository/src/main/java/org/apache/atlas/repository/graph/GraphHelper.java
View file @
d2b9b99f
...
...
@@ -109,8 +109,9 @@ public final class GraphHelper {
public
Edge
addEdge
(
Vertex
fromVertex
,
Vertex
toVertex
,
String
edgeLabel
)
{
LOG
.
debug
(
"Adding edge for {} -> label {} -> {}"
,
fromVertex
,
edgeLabel
,
toVertex
);
return
titanGraph
.
addEdge
(
null
,
fromVertex
,
toVertex
,
edgeLabel
);
Edge
edge
=
titanGraph
.
addEdge
(
null
,
fromVertex
,
toVertex
,
edgeLabel
);
LOG
.
debug
(
"Added edge for {} -> label {}, id {} -> {}"
,
fromVertex
,
edgeLabel
,
edge
.
getId
(),
toVertex
);
return
edge
;
}
public
Vertex
findVertex
(
String
propertyKey
,
Object
value
)
{
...
...
@@ -161,6 +162,7 @@ public final class GraphHelper {
}
else
{
if
(!
value
.
equals
(
existValue
))
{
vertex
.
setProperty
(
propertyName
,
value
);
LOG
.
debug
(
"Set property {} = \"{}\" to vertex {}"
,
propertyName
,
value
,
vertex
);
}
}
}
...
...
webapp/src/main/java/org/apache/atlas/web/resources/TypesResource.java
View file @
d2b9b99f
...
...
@@ -214,7 +214,7 @@ public class TypesResource {
}
catch
(
IllegalArgumentException
|
AtlasException
ie
)
{
LOG
.
error
(
"Unsupported typeName while retrieving type list {}"
,
type
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
"Unsupported type "
+
type
,
Response
.
Status
.
BAD_REQUEST
));
Servlets
.
getErrorResponse
(
new
Exception
(
"Unsupported type "
+
type
,
ie
)
,
Response
.
Status
.
BAD_REQUEST
));
}
catch
(
Throwable
e
)
{
LOG
.
error
(
"Unable to get types list"
,
e
);
throw
new
WebApplicationException
(
Servlets
.
getErrorResponse
(
e
,
Response
.
Status
.
INTERNAL_SERVER_ERROR
));
...
...
webapp/src/main/java/org/apache/atlas/web/util/Servlets.java
View file @
d2b9b99f
...
...
@@ -104,7 +104,8 @@ public final class Servlets {
}
public
static
Response
getErrorResponse
(
Throwable
e
,
Response
.
Status
status
)
{
Response
response
=
getErrorResponse
(
e
.
getMessage
(),
status
);
String
message
=
e
.
getMessage
()
==
null
?
"Failed with "
+
e
.
getClass
().
getName
()
:
e
.
getMessage
();
Response
response
=
getErrorResponse
(
message
,
status
);
JSONObject
responseJson
=
(
JSONObject
)
response
.
getEntity
();
try
{
responseJson
.
put
(
AtlasClient
.
STACKTRACE
,
printStackTrace
(
e
));
...
...
@@ -122,7 +123,7 @@ public final class Servlets {
public
static
Response
getErrorResponse
(
String
message
,
Response
.
Status
status
)
{
JSONObject
errorJson
=
new
JSONObject
();
Object
errorEntity
=
Servlets
.
escapeJsonString
(
message
);
Object
errorEntity
=
escapeJsonString
(
message
);
try
{
errorJson
.
put
(
AtlasClient
.
ERROR
,
errorEntity
);
errorEntity
=
errorJson
;
...
...
webapp/src/test/java/org/apache/atlas/web/util/ServletsTest.java
0 → 100644
View file @
d2b9b99f
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* <p/>
* http://www.apache.org/licenses/LICENSE-2.0
* <p/>
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org
.
apache
.
atlas
.
web
.
util
;
import
org.apache.atlas.AtlasClient
;
import
org.codehaus.jettison.json.JSONObject
;
import
org.testng.annotations.Test
;
import
javax.ws.rs.core.Response
;
import
static
org
.
testng
.
Assert
.*;
@Test
public
class
ServletsTest
{
public
void
testEmptyMessage
()
throws
Exception
{
//This shouldn't throw exception
Response
response
=
Servlets
.
getErrorResponse
(
new
NullPointerException
(),
Response
.
Status
.
INTERNAL_SERVER_ERROR
);
assertNotNull
(
response
);
JSONObject
responseEntity
=
(
JSONObject
)
response
.
getEntity
();
assertNotNull
(
responseEntity
);
assertNotNull
(
responseEntity
.
getString
(
AtlasClient
.
ERROR
));
}
}
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