|
@@ -21,6 +21,7 @@ import java.io.IOException;
|
|
|
|
|
|
import org.apache.hadoop.classification.InterfaceAudience;
|
|
|
import org.apache.hadoop.classification.InterfaceStability;
|
|
|
+import org.apache.hadoop.util.StringInterner;
|
|
|
|
|
|
/**
|
|
|
* Represents the network location of a block, information about the hosts
|
|
@@ -111,27 +112,27 @@ public class BlockLocation {
|
|
|
if (names == null) {
|
|
|
this.names = EMPTY_STR_ARRAY;
|
|
|
} else {
|
|
|
- this.names = names;
|
|
|
+ this.names = StringInterner.internStringsInArray(names);
|
|
|
}
|
|
|
if (hosts == null) {
|
|
|
this.hosts = EMPTY_STR_ARRAY;
|
|
|
} else {
|
|
|
- this.hosts = hosts;
|
|
|
+ this.hosts = StringInterner.internStringsInArray(hosts);
|
|
|
}
|
|
|
if (cachedHosts == null) {
|
|
|
this.cachedHosts = EMPTY_STR_ARRAY;
|
|
|
} else {
|
|
|
- this.cachedHosts = cachedHosts;
|
|
|
+ this.cachedHosts = StringInterner.internStringsInArray(cachedHosts);
|
|
|
}
|
|
|
if (topologyPaths == null) {
|
|
|
this.topologyPaths = EMPTY_STR_ARRAY;
|
|
|
} else {
|
|
|
- this.topologyPaths = topologyPaths;
|
|
|
+ this.topologyPaths = StringInterner.internStringsInArray(topologyPaths);
|
|
|
}
|
|
|
if (storageIds == null) {
|
|
|
this.storageIds = EMPTY_STR_ARRAY;
|
|
|
} else {
|
|
|
- this.storageIds = storageIds;
|
|
|
+ this.storageIds = StringInterner.internStringsInArray(storageIds);
|
|
|
}
|
|
|
if (storageTypes == null) {
|
|
|
this.storageTypes = EMPTY_STORAGE_TYPE_ARRAY;
|
|
@@ -235,7 +236,7 @@ public class BlockLocation {
|
|
|
if (hosts == null) {
|
|
|
this.hosts = EMPTY_STR_ARRAY;
|
|
|
} else {
|
|
|
- this.hosts = hosts;
|
|
|
+ this.hosts = StringInterner.internStringsInArray(hosts);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -246,7 +247,7 @@ public class BlockLocation {
|
|
|
if (cachedHosts == null) {
|
|
|
this.cachedHosts = EMPTY_STR_ARRAY;
|
|
|
} else {
|
|
|
- this.cachedHosts = cachedHosts;
|
|
|
+ this.cachedHosts = StringInterner.internStringsInArray(cachedHosts);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -257,7 +258,7 @@ public class BlockLocation {
|
|
|
if (names == null) {
|
|
|
this.names = EMPTY_STR_ARRAY;
|
|
|
} else {
|
|
|
- this.names = names;
|
|
|
+ this.names = StringInterner.internStringsInArray(names);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -268,7 +269,7 @@ public class BlockLocation {
|
|
|
if (topologyPaths == null) {
|
|
|
this.topologyPaths = EMPTY_STR_ARRAY;
|
|
|
} else {
|
|
|
- this.topologyPaths = topologyPaths;
|
|
|
+ this.topologyPaths = StringInterner.internStringsInArray(topologyPaths);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -276,7 +277,7 @@ public class BlockLocation {
|
|
|
if (storageIds == null) {
|
|
|
this.storageIds = EMPTY_STR_ARRAY;
|
|
|
} else {
|
|
|
- this.storageIds = storageIds;
|
|
|
+ this.storageIds = StringInterner.internStringsInArray(storageIds);
|
|
|
}
|
|
|
}
|
|
|
|