diff --git a/idl/replication.thrift b/idl/replication.thrift index 9af4436e..c816a806 100644 --- a/idl/replication.thrift +++ b/idl/replication.thrift @@ -28,4 +28,5 @@ struct query_cfg_response 3:i32 partition_count; 4:bool is_stateful; 5:list partitions; + 6:base.rpc_address forward_address; } diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_mutate_request.java b/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_mutate_request.java index c9c6b0b6..4c8fdd0c 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_mutate_request.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_mutate_request.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class check_and_mutate_request implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("check_and_mutate_request"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_mutate_response.java b/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_mutate_response.java index 48052afd..55dec1a8 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_mutate_response.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_mutate_response.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class check_and_mutate_response implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("check_and_mutate_response"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_set_request.java b/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_set_request.java index 9b04f21a..70985173 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_set_request.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_set_request.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class check_and_set_request implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("check_and_set_request"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_set_response.java b/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_set_response.java index b35d80e1..5217413e 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_set_response.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/check_and_set_response.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class check_and_set_response implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("check_and_set_response"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/count_response.java b/src/main/java/com/xiaomi/infra/pegasus/apps/count_response.java index be127696..8ee1691d 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/count_response.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/count_response.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class count_response implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("count_response"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/get_scanner_request.java b/src/main/java/com/xiaomi/infra/pegasus/apps/get_scanner_request.java index 8dc159fc..c4134750 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/get_scanner_request.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/get_scanner_request.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class get_scanner_request implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("get_scanner_request"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/incr_request.java b/src/main/java/com/xiaomi/infra/pegasus/apps/incr_request.java index c79648ce..703cacab 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/incr_request.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/incr_request.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class incr_request implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("incr_request"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/incr_response.java b/src/main/java/com/xiaomi/infra/pegasus/apps/incr_response.java index 5ab054e0..c6a89e80 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/incr_response.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/incr_response.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class incr_response implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("incr_response"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/key_value.java b/src/main/java/com/xiaomi/infra/pegasus/apps/key_value.java index 85efebb2..741bd50b 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/key_value.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/key_value.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class key_value implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("key_value"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/meta.java b/src/main/java/com/xiaomi/infra/pegasus/apps/meta.java index 821106c1..cd25f411 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/meta.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/meta.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class meta { public interface Iface { diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/multi_get_request.java b/src/main/java/com/xiaomi/infra/pegasus/apps/multi_get_request.java index c60070c2..fecb8b22 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/multi_get_request.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/multi_get_request.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class multi_get_request implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("multi_get_request"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/multi_get_response.java b/src/main/java/com/xiaomi/infra/pegasus/apps/multi_get_response.java index 8a029fee..0a9af533 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/multi_get_response.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/multi_get_response.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class multi_get_response implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("multi_get_response"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/multi_put_request.java b/src/main/java/com/xiaomi/infra/pegasus/apps/multi_put_request.java index 60e6a03a..10f79fa4 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/multi_put_request.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/multi_put_request.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class multi_put_request implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("multi_put_request"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/multi_remove_request.java b/src/main/java/com/xiaomi/infra/pegasus/apps/multi_remove_request.java index 8385ea7b..3e1a53b1 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/multi_remove_request.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/multi_remove_request.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class multi_remove_request implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("multi_remove_request"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/multi_remove_response.java b/src/main/java/com/xiaomi/infra/pegasus/apps/multi_remove_response.java index 5fb01c0c..23099ad1 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/multi_remove_response.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/multi_remove_response.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class multi_remove_response implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("multi_remove_response"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/mutate.java b/src/main/java/com/xiaomi/infra/pegasus/apps/mutate.java index c633d95f..55730d41 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/mutate.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/mutate.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class mutate implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("mutate"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/read_response.java b/src/main/java/com/xiaomi/infra/pegasus/apps/read_response.java index ac159cce..5b9b845a 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/read_response.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/read_response.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class read_response implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("read_response"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/rrdb.java b/src/main/java/com/xiaomi/infra/pegasus/apps/rrdb.java index 007ba6e5..15c7c70c 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/rrdb.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/rrdb.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class rrdb { public interface Iface { diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/scan_request.java b/src/main/java/com/xiaomi/infra/pegasus/apps/scan_request.java index d80149ff..73e069ca 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/scan_request.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/scan_request.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class scan_request implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("scan_request"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/scan_response.java b/src/main/java/com/xiaomi/infra/pegasus/apps/scan_response.java index 6eecb4b5..39a853b5 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/scan_response.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/scan_response.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class scan_response implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("scan_response"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/ttl_response.java b/src/main/java/com/xiaomi/infra/pegasus/apps/ttl_response.java index ecb1a3d2..b13803f8 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/ttl_response.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/ttl_response.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class ttl_response implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("ttl_response"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/update_request.java b/src/main/java/com/xiaomi/infra/pegasus/apps/update_request.java index 6a8346f7..893d8a13 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/update_request.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/update_request.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class update_request implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("update_request"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/apps/update_response.java b/src/main/java/com/xiaomi/infra/pegasus/apps/update_response.java index 36258413..8f9bd6d4 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/apps/update_response.java +++ b/src/main/java/com/xiaomi/infra/pegasus/apps/update_response.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.apps; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class update_response implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("update_response"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/replication/partition_configuration.java b/src/main/java/com/xiaomi/infra/pegasus/replication/partition_configuration.java index 80f0880b..dc087ba0 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/replication/partition_configuration.java +++ b/src/main/java/com/xiaomi/infra/pegasus/replication/partition_configuration.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.replication; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class partition_configuration implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("partition_configuration"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/replication/query_cfg_request.java b/src/main/java/com/xiaomi/infra/pegasus/replication/query_cfg_request.java index 4d28e5fc..ce8c3d53 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/replication/query_cfg_request.java +++ b/src/main/java/com/xiaomi/infra/pegasus/replication/query_cfg_request.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.replication; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class query_cfg_request implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("query_cfg_request"); diff --git a/src/main/java/com/xiaomi/infra/pegasus/replication/query_cfg_response.java b/src/main/java/com/xiaomi/infra/pegasus/replication/query_cfg_response.java index aea71146..70b407f2 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/replication/query_cfg_response.java +++ b/src/main/java/com/xiaomi/infra/pegasus/replication/query_cfg_response.java @@ -10,7 +10,7 @@ package com.xiaomi.infra.pegasus.replication; @SuppressWarnings({"cast", "rawtypes", "serial", "unchecked", "unused"}) -@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-09-19") +@javax.annotation.Generated(value = "Autogenerated by Thrift Compiler (0.11.0)", date = "2018-12-27") public class query_cfg_response implements com.xiaomi.infra.pegasus.thrift.TBase, java.io.Serializable, Cloneable, Comparable { private static final com.xiaomi.infra.pegasus.thrift.protocol.TStruct STRUCT_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TStruct("query_cfg_response"); @@ -19,6 +19,7 @@ public class query_cfg_response implements com.xiaomi.infra.pegasus.thrift.TBase private static final com.xiaomi.infra.pegasus.thrift.protocol.TField PARTITION_COUNT_FIELD_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TField("partition_count", com.xiaomi.infra.pegasus.thrift.protocol.TType.I32, (short)3); private static final com.xiaomi.infra.pegasus.thrift.protocol.TField IS_STATEFUL_FIELD_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TField("is_stateful", com.xiaomi.infra.pegasus.thrift.protocol.TType.BOOL, (short)4); private static final com.xiaomi.infra.pegasus.thrift.protocol.TField PARTITIONS_FIELD_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TField("partitions", com.xiaomi.infra.pegasus.thrift.protocol.TType.LIST, (short)5); + private static final com.xiaomi.infra.pegasus.thrift.protocol.TField FORWARD_ADDRESS_FIELD_DESC = new com.xiaomi.infra.pegasus.thrift.protocol.TField("forward_address", com.xiaomi.infra.pegasus.thrift.protocol.TType.STRUCT, (short)6); private static final com.xiaomi.infra.pegasus.thrift.scheme.SchemeFactory STANDARD_SCHEME_FACTORY = new query_cfg_responseStandardSchemeFactory(); private static final com.xiaomi.infra.pegasus.thrift.scheme.SchemeFactory TUPLE_SCHEME_FACTORY = new query_cfg_responseTupleSchemeFactory(); @@ -28,6 +29,7 @@ public class query_cfg_response implements com.xiaomi.infra.pegasus.thrift.TBase public int partition_count; // required public boolean is_stateful; // required public java.util.List partitions; // required + public com.xiaomi.infra.pegasus.base.rpc_address forward_address; // required /** The set of fields this struct contains, along with convenience methods for finding and manipulating them. */ public enum _Fields implements com.xiaomi.infra.pegasus.thrift.TFieldIdEnum { @@ -35,7 +37,8 @@ public enum _Fields implements com.xiaomi.infra.pegasus.thrift.TFieldIdEnum { APP_ID((short)2, "app_id"), PARTITION_COUNT((short)3, "partition_count"), IS_STATEFUL((short)4, "is_stateful"), - PARTITIONS((short)5, "partitions"); + PARTITIONS((short)5, "partitions"), + FORWARD_ADDRESS((short)6, "forward_address"); private static final java.util.Map byName = new java.util.HashMap(); @@ -60,6 +63,8 @@ public static _Fields findByThriftId(int fieldId) { return IS_STATEFUL; case 5: // PARTITIONS return PARTITIONS; + case 6: // FORWARD_ADDRESS + return FORWARD_ADDRESS; default: return null; } @@ -118,6 +123,8 @@ public java.lang.String getFieldName() { tmpMap.put(_Fields.PARTITIONS, new com.xiaomi.infra.pegasus.thrift.meta_data.FieldMetaData("partitions", com.xiaomi.infra.pegasus.thrift.TFieldRequirementType.DEFAULT, new com.xiaomi.infra.pegasus.thrift.meta_data.ListMetaData(com.xiaomi.infra.pegasus.thrift.protocol.TType.LIST, new com.xiaomi.infra.pegasus.thrift.meta_data.StructMetaData(com.xiaomi.infra.pegasus.thrift.protocol.TType.STRUCT, partition_configuration.class)))); + tmpMap.put(_Fields.FORWARD_ADDRESS, new com.xiaomi.infra.pegasus.thrift.meta_data.FieldMetaData("forward_address", com.xiaomi.infra.pegasus.thrift.TFieldRequirementType.DEFAULT, + new com.xiaomi.infra.pegasus.thrift.meta_data.StructMetaData(com.xiaomi.infra.pegasus.thrift.protocol.TType.STRUCT, com.xiaomi.infra.pegasus.base.rpc_address.class))); metaDataMap = java.util.Collections.unmodifiableMap(tmpMap); com.xiaomi.infra.pegasus.thrift.meta_data.FieldMetaData.addStructMetaDataMap(query_cfg_response.class, metaDataMap); } @@ -130,7 +137,8 @@ public query_cfg_response( int app_id, int partition_count, boolean is_stateful, - java.util.List partitions) + java.util.List partitions, + com.xiaomi.infra.pegasus.base.rpc_address forward_address) { this(); this.err = err; @@ -141,6 +149,7 @@ public query_cfg_response( this.is_stateful = is_stateful; setIs_statefulIsSet(true); this.partitions = partitions; + this.forward_address = forward_address; } /** @@ -161,6 +170,9 @@ public query_cfg_response(query_cfg_response other) { } this.partitions = __this__partitions; } + if (other.isSetForward_address()) { + this.forward_address = new com.xiaomi.infra.pegasus.base.rpc_address(other.forward_address); + } } public query_cfg_response deepCopy() { @@ -177,6 +189,7 @@ public void clear() { setIs_statefulIsSet(false); this.is_stateful = false; this.partitions = null; + this.forward_address = null; } public com.xiaomi.infra.pegasus.base.error_code getErr() { @@ -311,6 +324,30 @@ public void setPartitionsIsSet(boolean value) { } } + public com.xiaomi.infra.pegasus.base.rpc_address getForward_address() { + return this.forward_address; + } + + public query_cfg_response setForward_address(com.xiaomi.infra.pegasus.base.rpc_address forward_address) { + this.forward_address = forward_address; + return this; + } + + public void unsetForward_address() { + this.forward_address = null; + } + + /** Returns true if field forward_address is set (has been assigned a value) and false otherwise */ + public boolean isSetForward_address() { + return this.forward_address != null; + } + + public void setForward_addressIsSet(boolean value) { + if (!value) { + this.forward_address = null; + } + } + public void setFieldValue(_Fields field, java.lang.Object value) { switch (field) { case ERR: @@ -353,6 +390,14 @@ public void setFieldValue(_Fields field, java.lang.Object value) { } break; + case FORWARD_ADDRESS: + if (value == null) { + unsetForward_address(); + } else { + setForward_address((com.xiaomi.infra.pegasus.base.rpc_address)value); + } + break; + } } @@ -373,6 +418,9 @@ public java.lang.Object getFieldValue(_Fields field) { case PARTITIONS: return getPartitions(); + case FORWARD_ADDRESS: + return getForward_address(); + } throw new java.lang.IllegalStateException(); } @@ -394,6 +442,8 @@ public boolean isSet(_Fields field) { return isSetIs_stateful(); case PARTITIONS: return isSetPartitions(); + case FORWARD_ADDRESS: + return isSetForward_address(); } throw new java.lang.IllegalStateException(); } @@ -458,6 +508,15 @@ public boolean equals(query_cfg_response that) { return false; } + boolean this_present_forward_address = true && this.isSetForward_address(); + boolean that_present_forward_address = true && that.isSetForward_address(); + if (this_present_forward_address || that_present_forward_address) { + if (!(this_present_forward_address && that_present_forward_address)) + return false; + if (!this.forward_address.equals(that.forward_address)) + return false; + } + return true; } @@ -479,6 +538,10 @@ public int hashCode() { if (isSetPartitions()) hashCode = hashCode * 8191 + partitions.hashCode(); + hashCode = hashCode * 8191 + ((isSetForward_address()) ? 131071 : 524287); + if (isSetForward_address()) + hashCode = hashCode * 8191 + forward_address.hashCode(); + return hashCode; } @@ -540,6 +603,16 @@ public int compareTo(query_cfg_response other) { return lastComparison; } } + lastComparison = java.lang.Boolean.valueOf(isSetForward_address()).compareTo(other.isSetForward_address()); + if (lastComparison != 0) { + return lastComparison; + } + if (isSetForward_address()) { + lastComparison = com.xiaomi.infra.pegasus.thrift.TBaseHelper.compareTo(this.forward_address, other.forward_address); + if (lastComparison != 0) { + return lastComparison; + } + } return 0; } @@ -587,6 +660,14 @@ public java.lang.String toString() { sb.append(this.partitions); } first = false; + if (!first) sb.append(", "); + sb.append("forward_address:"); + if (this.forward_address == null) { + sb.append("null"); + } else { + sb.append(this.forward_address); + } + first = false; sb.append(")"); return sb.toString(); } @@ -597,6 +678,9 @@ public void validate() throws com.xiaomi.infra.pegasus.thrift.TException { if (err != null) { err.validate(); } + if (forward_address != null) { + forward_address.validate(); + } } private void writeObject(java.io.ObjectOutputStream out) throws java.io.IOException { @@ -687,6 +771,15 @@ public void read(com.xiaomi.infra.pegasus.thrift.protocol.TProtocol iprot, query com.xiaomi.infra.pegasus.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } break; + case 6: // FORWARD_ADDRESS + if (schemeField.type == com.xiaomi.infra.pegasus.thrift.protocol.TType.STRUCT) { + struct.forward_address = new com.xiaomi.infra.pegasus.base.rpc_address(); + struct.forward_address.read(iprot); + struct.setForward_addressIsSet(true); + } else { + com.xiaomi.infra.pegasus.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); + } + break; default: com.xiaomi.infra.pegasus.thrift.protocol.TProtocolUtil.skip(iprot, schemeField.type); } @@ -728,6 +821,11 @@ public void write(com.xiaomi.infra.pegasus.thrift.protocol.TProtocol oprot, quer } oprot.writeFieldEnd(); } + if (struct.forward_address != null) { + oprot.writeFieldBegin(FORWARD_ADDRESS_FIELD_DESC); + struct.forward_address.write(oprot); + oprot.writeFieldEnd(); + } oprot.writeFieldStop(); oprot.writeStructEnd(); } @@ -761,7 +859,10 @@ public void write(com.xiaomi.infra.pegasus.thrift.protocol.TProtocol prot, query if (struct.isSetPartitions()) { optionals.set(4); } - oprot.writeBitSet(optionals, 5); + if (struct.isSetForward_address()) { + optionals.set(5); + } + oprot.writeBitSet(optionals, 6); if (struct.isSetErr()) { struct.err.write(oprot); } @@ -783,12 +884,15 @@ public void write(com.xiaomi.infra.pegasus.thrift.protocol.TProtocol prot, query } } } + if (struct.isSetForward_address()) { + struct.forward_address.write(oprot); + } } @Override public void read(com.xiaomi.infra.pegasus.thrift.protocol.TProtocol prot, query_cfg_response struct) throws com.xiaomi.infra.pegasus.thrift.TException { com.xiaomi.infra.pegasus.thrift.protocol.TTupleProtocol iprot = (com.xiaomi.infra.pegasus.thrift.protocol.TTupleProtocol) prot; - java.util.BitSet incoming = iprot.readBitSet(5); + java.util.BitSet incoming = iprot.readBitSet(6); if (incoming.get(0)) { struct.err = new com.xiaomi.infra.pegasus.base.error_code(); struct.err.read(iprot); @@ -820,6 +924,11 @@ public void read(com.xiaomi.infra.pegasus.thrift.protocol.TProtocol prot, query_ } struct.setPartitionsIsSet(true); } + if (incoming.get(5)) { + struct.forward_address = new com.xiaomi.infra.pegasus.base.rpc_address(); + struct.forward_address.read(iprot); + struct.setForward_addressIsSet(true); + } } } diff --git a/src/main/java/com/xiaomi/infra/pegasus/rpc/async/MetaSession.java b/src/main/java/com/xiaomi/infra/pegasus/rpc/async/MetaSession.java index 5ccaf2c6..cb97f1c0 100644 --- a/src/main/java/com/xiaomi/infra/pegasus/rpc/async/MetaSession.java +++ b/src/main/java/com/xiaomi/infra/pegasus/rpc/async/MetaSession.java @@ -22,18 +22,20 @@ public class MetaSession { public MetaSession(ClusterManager manager, String addrList[], int eachQueryTimeoutInMills, int defaultMaxQueryCount, EventLoopGroup g) throws IllegalArgumentException { + clusterManager = manager; metaList = new ArrayList(); for (String addr : addrList) { rpc_address rpc_addr = new rpc_address(); if (rpc_addr.fromString(addr)) { logger.info("add {} as meta server", addr); - metaList.add(manager.getReplicaSession(rpc_addr)); - } else { + metaList.add(clusterManager.getReplicaSession(rpc_addr)); + } + else { logger.error("invalid address {}", addr); } } if (metaList.isEmpty()) { - throw new IllegalArgumentException("can't find valid meta server address " + addrList.toString()); + throw new IllegalArgumentException("no valid meta server address"); } curLeader = 0; @@ -49,6 +51,13 @@ static public final error_types getMetaServiceError(client_operator metaQueryOp) return op.get_response().getErr().errno; } + static public final rpc_address getMetaServiceForwardAddress(client_operator metaQueryOp) { + if (metaQueryOp.rpc_error.errno != error_types.ERR_OK) + return null; + query_cfg_operator op = (query_cfg_operator) metaQueryOp; + return op.get_response().getForward_address(); + } + public final void asyncQuery(client_operator op, Runnable callbackFunc, int maxQueryCount) { if (maxQueryCount == 0) { maxQueryCount = defaultMaxQueryCount; @@ -101,6 +110,7 @@ private final void onFinishQueryMeta(final MetaRequestRound round) { boolean needDelay = false; boolean needSwitchLeader = false; + rpc_address forwardAddress = null; --round.maxQueryCount; if (round.maxQueryCount == 0) { @@ -117,7 +127,9 @@ private final void onFinishQueryMeta(final MetaRequestRound round) { } else if (metaError == error_types.ERR_FORWARD_TO_OTHERS) { needDelay = false; needSwitchLeader = true; - } else { + forwardAddress = getMetaServiceForwardAddress(op); + } + else { round.callbackFunc.run(); return; } @@ -130,18 +142,36 @@ private final void onFinishQueryMeta(final MetaRequestRound round) { return; } - logger.info("query meta got error, rpc({}), meta({}), connected leader({}), remain retry count({}), " + - "need switch leader({}), need delay({})", + logger.info("query meta got error, rpc error({}), meta error({}), forward address({}), current leader({}), " + + "remain retry count({}), need switch leader({}), need delay({})", op.rpc_error.errno.toString(), metaError.toString(), + forwardAddress, round.lastSession.name(), round.maxQueryCount, needSwitchLeader, needDelay ); synchronized (this) { - if (needSwitchLeader && metaList.get(curLeader) == round.lastSession) { - curLeader = (curLeader + 1) % metaList.size(); + if (needSwitchLeader) { + if (forwardAddress != null && !forwardAddress.isInvalid()) { + boolean found = false; + for (int i = 0; i < metaList.size(); i++) { + if (metaList.get(i).getAddress().equals(forwardAddress)) { + curLeader = i; + found = true; + break; + } + } + if (!found) { + logger.info("add forward address {} as meta server", forwardAddress); + metaList.add(clusterManager.getReplicaSession(forwardAddress)); + curLeader = metaList.size() - 1; + } + } + else if (metaList.get(curLeader) == round.lastSession) { + curLeader = (curLeader + 1) % metaList.size(); + } } round.lastSession = metaList.get(curLeader); } @@ -168,6 +198,7 @@ public MetaRequestRound(client_operator o, Runnable r, int q, ReplicaSession l) } } + private ClusterManager clusterManager; private List metaList; private int curLeader; private int eachQueryTimeoutInMills;