You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@atlas.apache.org by ma...@apache.org on 2016/12/23 01:46:43 UTC
[14/50] [abbrv] incubator-atlas git commit: ATLAS-1112: Hive hook
notification contains multiple entities with same ID
ATLAS-1112: Hive hook notification contains multiple entities with same ID
(cherry picked from commit bf2e60917b7f202ccfa45accbdd836c7513427f2)
Project: http://git-wip-us.apache.org/repos/asf/incubator-atlas/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-atlas/commit/f8bdac05
Tree: http://git-wip-us.apache.org/repos/asf/incubator-atlas/tree/f8bdac05
Diff: http://git-wip-us.apache.org/repos/asf/incubator-atlas/diff/f8bdac05
Branch: refs/heads/0.7-incubating
Commit: f8bdac0550722fdb411f7b1dc575f134167a8a27
Parents: e1b108f
Author: Ayub Khan <ar...@gmail.com>
Authored: Thu Aug 11 11:00:02 2016 -0700
Committer: Madhan Neethiraj <ma...@apache.org>
Committed: Thu Dec 22 15:13:33 2016 -0800
----------------------------------------------------------------------
release-log.txt | 1 +
.../org/apache/atlas/typesystem/persistence/Id.java | 16 +++++++++++++++-
2 files changed, 16 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f8bdac05/release-log.txt
----------------------------------------------------------------------
diff --git a/release-log.txt b/release-log.txt
index 333b98e..f4f794b 100644
--- a/release-log.txt
+++ b/release-log.txt
@@ -28,6 +28,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-1112 Hive table GET response from atlas server had duplicate column entries ( ayubkhan, mneethiraj via sumasai)
ATLAS-1108 In Atlas HA mode , import-hive.sh in Passive instance fails. (ayubkhan via sumasai)
ATLAS-1104 Get outgoing edges by label doesn't work in some cases (shwethags)
ATLAS-1105 Disable HiveLiteralRewriterTest since its not used currently (sumasai)
http://git-wip-us.apache.org/repos/asf/incubator-atlas/blob/f8bdac05/typesystem/src/main/java/org/apache/atlas/typesystem/persistence/Id.java
----------------------------------------------------------------------
diff --git a/typesystem/src/main/java/org/apache/atlas/typesystem/persistence/Id.java b/typesystem/src/main/java/org/apache/atlas/typesystem/persistence/Id.java
index 04e220d..42280d0 100755
--- a/typesystem/src/main/java/org/apache/atlas/typesystem/persistence/Id.java
+++ b/typesystem/src/main/java/org/apache/atlas/typesystem/persistence/Id.java
@@ -33,6 +33,7 @@ import java.security.MessageDigest;
import java.util.Date;
import java.util.Map;
import java.util.UUID;
+import java.util.concurrent.atomic.AtomicLong;
public class Id implements ITypedReferenceableInstance {
public enum EntityState {
@@ -43,6 +44,7 @@ public class Id implements ITypedReferenceableInstance {
public final String typeName;
public final int version;
public EntityState state;
+ private static AtomicLong s_nextId = new AtomicLong(System.nanoTime());
public Id(String id, int version, String typeName, String state) {
id = ParamChecker.notEmpty(id, "id");
@@ -71,7 +73,7 @@ public class Id implements ITypedReferenceableInstance {
}
public Id(String typeName) {
- this("" + (-System.nanoTime()), 0, typeName);
+ this("" + Id.nextNegativeLong(), 0, typeName);
}
public boolean isUnassigned() {
@@ -294,4 +296,16 @@ public class Id implements ITypedReferenceableInstance {
byte[] digest = digester.digest();
return MD5Utils.toString(digest);
}
+
+ private static long nextNegativeLong() {
+ long ret = s_nextId.getAndDecrement();
+
+ if (ret > 0) {
+ ret *= -1;
+ } else if (ret == 0) {
+ ret = Long.MIN_VALUE;
+ }
+
+ return ret;
+ }
}