Github user DaveBirdsall commented on a diff in the pull request:
https://github.com/apache/incubator-trafodion/pull/1028#discussion_r108504021
--- Diff:
core/sqf/src/seatrans/tm/hbasetmlib2/src/main/java/org/trafodion/dtm/HBaseTxClient.java
---
@@ -1264,64 +1265,40 @@ public HashMapArray callRequestRegionInfo() throws
IOException {
TransactionState ts = mapTransactionStates.get(id);
final Set<TransactionRegionLocation> regions =
ts.getParticipatingRegions();
- // TableName
Iterator<TransactionRegionLocation> it = regions.iterator();
- tablename =
it.next().getRegionInfo().getTable().getNameAsString();
- while(it.hasNext()){
- tablename = tablename + ";" +
it.next().getRegionInfo().getTable().getNameAsString();
- }
- hm.addElement(tnum, "TableName", tablename);
-
- // Encoded Region Name
- Iterator<TransactionRegionLocation> it2 = regions.iterator();
- encoded_region_name =
it2.next().getRegionInfo().getEncodedName();
- while(it2.hasNext()){
- encoded_region_name = encoded_region_name + ";" +
it2.next().getRegionInfo().getTable().getNameAsString();
- }
- hm.addElement(tnum, "EncodedRegionName", encoded_region_name);
-
- // Region Name
- Iterator<TransactionRegionLocation> it3 = regions.iterator();
- region_name = it3.next().getRegionInfo().getRegionNameAsString();
- while(it3.hasNext()){
- region_name = region_name + ";" +
it3.next().getRegionInfo().getTable().getNameAsString();
- }
- hm.addElement(tnum, "RegionName", region_name);
-
- // Region Offline
- Iterator<TransactionRegionLocation> it4 = regions.iterator();
- boolean is_offline_bool = it4.next().getRegionInfo().isOffline();
- is_offline = String.valueOf(is_offline_bool);
- hm.addElement(tnum, "RegionOffline", is_offline);
-
- // Region ID
- Iterator<TransactionRegionLocation> it5 = regions.iterator();
- region_id =
String.valueOf(it5.next().getRegionInfo().getRegionId());
- while(it5.hasNext()){
- region_id = region_id + ";" +
it5.next().getRegionInfo().getRegionId();
- }
- hm.addElement(tnum, "RegionID", region_id);
-
- // Hostname
- Iterator<TransactionRegionLocation> it6 = regions.iterator();
- thn = String.valueOf(it6.next().getHostname());
- hostname = thn.substring(0, thn.length()-1);
- while(it6.hasNext()){
- thn = String.valueOf(it6.next().getHostname());
- hostname = hostname + ";" + thn.substring(0, thn.length()-1);
- }
- hm.addElement(tnum, "Hostname", hostname);
-
- // Port
- Iterator<TransactionRegionLocation> it7 = regions.iterator();
- port = String.valueOf(it7.next().getPort());
- while(it7.hasNext()){
- port = port + ";" + String.valueOf(it7.next().getPort());
- }
- hm.addElement(tnum, "Port", port);
+
+ while(it.hasNext()) {
+ TransactionRegionLocation trl = it.next();
+ tablename = trl.getRegionInfo().getTable().getNameAsString();
+ if(tablename.contains("_MD_"))
--- End diff --
This test might be "good enough" but it is not sharp if your intent is to
exclude just metadata tables. I might, for example, create a table X_MD_YZ.
Even "._MD." isn't good enough because I can use a delimited identifier and
create a table "X._MD_.YZ". I'm curious why we want to exclude metadata tables
at all?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---