2121@ SuppressFBWarnings ({"EI_EXPOSE_REP" , "EI_EXPOSE_REP2" })
2222@ Immutable
2323public class ObjectStorageTableMetadata {
24- public static final Integer DEFAULT_VERSION = 1 ;
2524 private final LinkedHashSet <String > partitionKeyNames ;
2625 private final LinkedHashSet <String > clusteringKeyNames ;
2726 private final Map <String , String > clusteringOrders ;
2827 private final Set <String > secondaryIndexNames ;
2928 private final Map <String , String > columns ;
30- private final Integer version ;
3129
3230 @ JsonCreator
3331 public ObjectStorageTableMetadata (
3432 @ JsonProperty ("partitionKeyNames" ) @ Nullable LinkedHashSet <String > partitionKeyNames ,
3533 @ JsonProperty ("clusteringKeyNames" ) @ Nullable LinkedHashSet <String > clusteringKeyNames ,
3634 @ JsonProperty ("clusteringOrders" ) @ Nullable Map <String , String > clusteringOrders ,
3735 @ JsonProperty ("secondaryIndexNames" ) @ Nullable Set <String > secondaryIndexNames ,
38- @ JsonProperty ("columns" ) @ Nullable Map <String , String > columns ,
39- @ JsonProperty ("version" ) @ Nullable Integer version ) {
36+ @ JsonProperty ("columns" ) @ Nullable Map <String , String > columns ) {
4037 this .partitionKeyNames =
4138 partitionKeyNames != null ? new LinkedHashSet <>(partitionKeyNames ) : new LinkedHashSet <>();
4239 this .clusteringKeyNames =
@@ -48,10 +45,9 @@ public ObjectStorageTableMetadata(
4845 this .secondaryIndexNames =
4946 secondaryIndexNames != null ? new HashSet <>(secondaryIndexNames ) : Collections .emptySet ();
5047 this .columns = columns != null ? new HashMap <>(columns ) : Collections .emptyMap ();
51- this .version = version != null ? version : DEFAULT_VERSION ;
5248 }
5349
54- public ObjectStorageTableMetadata (TableMetadata tableMetadata , Integer version ) {
50+ public ObjectStorageTableMetadata (TableMetadata tableMetadata ) {
5551 Map <String , String > clusteringOrders =
5652 tableMetadata .getClusteringKeyNames ().stream ()
5753 .collect (
@@ -69,11 +65,6 @@ public ObjectStorageTableMetadata(TableMetadata tableMetadata, Integer version)
6965 this .clusteringOrders = clusteringOrders ;
7066 this .secondaryIndexNames = tableMetadata .getSecondaryIndexNames ();
7167 this .columns = columnTypeByName ;
72- this .version = version ;
73- }
74-
75- public ObjectStorageTableMetadata (TableMetadata tableMetadata ) {
76- this (tableMetadata , DEFAULT_VERSION );
7768 }
7869
7970 private ObjectStorageTableMetadata (Builder builder ) {
@@ -82,8 +73,7 @@ private ObjectStorageTableMetadata(Builder builder) {
8273 builder .clusteringKeyNames ,
8374 builder .clusteringOrders ,
8475 builder .secondaryIndexNames ,
85- builder .columns ,
86- builder .version );
76+ builder .columns );
8777 }
8878
8979 public LinkedHashSet <String > getPartitionKeyNames () {
@@ -106,10 +96,6 @@ public Map<String, String> getColumns() {
10696 return columns ;
10797 }
10898
109- public Integer getVersion () {
110- return version ;
111- }
112-
11399 @ Override
114100 public boolean equals (Object o ) {
115101 if (this == o ) {
@@ -123,19 +109,13 @@ public boolean equals(Object o) {
123109 && Objects .equals (clusteringKeyNames , that .clusteringKeyNames )
124110 && Objects .equals (clusteringOrders , that .clusteringOrders )
125111 && Objects .equals (secondaryIndexNames , that .secondaryIndexNames )
126- && Objects .equals (columns , that .columns )
127- && Objects .equals (version , that .version );
112+ && Objects .equals (columns , that .columns );
128113 }
129114
130115 @ Override
131116 public int hashCode () {
132117 return Objects .hash (
133- partitionKeyNames ,
134- clusteringKeyNames ,
135- clusteringOrders ,
136- secondaryIndexNames ,
137- columns ,
138- version );
118+ partitionKeyNames , clusteringKeyNames , clusteringOrders , secondaryIndexNames , columns );
139119 }
140120
141121 public TableMetadata toTableMetadata () {
@@ -187,7 +167,6 @@ public static final class Builder {
187167 private Map <String , String > clusteringOrders ;
188168 private Set <String > secondaryIndexNames ;
189169 private Map <String , String > columns ;
190- private Integer version ;
191170
192171 private Builder () {}
193172
@@ -216,11 +195,6 @@ public ObjectStorageTableMetadata.Builder columns(Map<String, String> val) {
216195 return this ;
217196 }
218197
219- public ObjectStorageTableMetadata .Builder version (Integer val ) {
220- version = val ;
221- return this ;
222- }
223-
224198 public ObjectStorageTableMetadata build () {
225199 return new ObjectStorageTableMetadata (this );
226200 }
0 commit comments