public boolean isStatsKey() { return (this.getFormat() == EDGE_FORMAT.STATS); }
public Key encodeLegacyAttribute2Key() { if (this.getFormat() == EDGE_FORMAT.STATS) { return encode(EDGE_VERSION.STATS_ATTRIBUTE2); } else if (this.getFormat() == EDGE_FORMAT.STANDARD) { return encode(EDGE_VERSION.BASE_ATTRIBUTE2); } else { // EDGE_FORMAT.UNKNOWN throw new IllegalStateException("Can't encode unknown edge key format." + this); } }
public Key encodeLegacyKey() { if (this.getFormat() == EDGE_FORMAT.STATS) { return encode(EDGE_VERSION.STATS_BASE); } else if (this.getFormat() == EDGE_FORMAT.STANDARD) { return encode(EDGE_VERSION.BASE); } else { // EDGE_FORMAT.UNKNOWN throw new IllegalStateException("Can't encode unknown edge key format." + this); } }
public Key encodeLegacyProtobufKey() { if (this.getFormat() == EDGE_FORMAT.STATS) { return encode(EDGE_VERSION.STATS_PROTOBUF); } else if (this.getFormat() == EDGE_FORMAT.STANDARD) { return encode(EDGE_VERSION.PROTOBUF); } else { // EDGE_FORMAT.UNKNOWN throw new IllegalStateException("Can't encode unknown edge key format." + this); } }
public String getAttribute1() { // return a relationship string based on the edge type. if ((this.getFormat() == EDGE_FORMAT.STANDARD) || ((getFormat() == EDGE_FORMAT.STATS) && this.getStatsType() == STATS_TYPE.LINKS)) { return getSourceAttribute1() + COL_SUB_SEPARATOR + getSinkAttribute1(); } return getSourceAttribute1(); }
/** * Creates an edge table key from the various EdgeKey fields. * * @return a key for the Datawave edge table */ public Key encode() { if (this.getDateType() == DATE_TYPE.OLD_EVENT) { return encodeLegacyProtobufKey(); } else { if (this.getFormat() == EDGE_FORMAT.STATS) { return encode(EDGE_VERSION.DATE_STATS_PROTOBUF); } else if (this.getFormat() == EDGE_FORMAT.STANDARD) { return encode(EDGE_VERSION.DATE_PROTOBUF); } else { // EDGE_FORMAT.UNKNOWN throw new IllegalStateException("Can't encode unknown edge key format." + this); } } }
public String getRelationship() { // return a relationship string based on the edge type. if (this.getFormat() == EDGE_FORMAT.STANDARD) { return getSourceRelationship() + COL_SUB_SEPARATOR + getSinkRelationship(); } return getSourceRelationship(); }
private EdgeKeyBuilder(EdgeKey key) { escape = false; format = key.getFormat(); statsType = key.getStatsType(); sourceData = key.getSourceData(); sinkData = key.getSinkData(); type = key.getType(); unescape = false; sourceRelationship = key.getSourceRelationship(); sinkRelationship = key.getSinkRelationship(); sourceAttribute1 = key.getSourceAttribute1(); sinkAttribute1 = key.getSinkAttribute1(); attribute2 = key.getAttribute2(); attribute3 = key.getAttribute3(); yyyymmdd = key.getYyyymmdd(); dateType = key.getDateType(); colvis = new Text(key.getColvis()); timestamp = key.getTimestamp(); deleted = key.isDeleted(); }