kikocis/java-driver public
Changesets · Branches · Tags · Compare
| Changeset | 33225dc7a799121a2e9a92bde50672792dd13ab4f578807c03305003930d752e |
|---|---|
| Author | Alexandre Dutra <adutra@users.noreply.github.com> · 2017-02-10 17:12 +01:00 |
| Committer | GitHub <noreply@github.com> · 2017-02-10 17:12 +01:00 |
| Parents | 81c62674441f, a3dbacfe2a6d |
2 files changed
modified changelog/README.md +1 −0
| @@ -4,6 +4,7 @@ | ||
| 4 | 4 | |
| 5 | 5 | - [bug] JAVA-1371: Reintroduce connection pool timeout. |
| 6 | 6 | - [bug] JAVA-1313: Copy SerialConsistencyLevel to PreparedStatement. |
| 7 | +- [documentation] JAVA-1334: Clarify documentation of method `addContactPoints`. | |
| 7 | 8 | |
| 8 | 9 | |
| 9 | 10 | ### 3.0.6 |
modified driver-core/src/main/java/com/datastax/driver/core/Cluster.java +29 −19
| @@ -803,7 +803,7 @@ | ||
| 803 | 803 | } |
| 804 | 804 | |
| 805 | 805 | /** |
| 806 | - * Adds a contact point - or many if it host resolves to multiple | |
| 806 | + * Adds a contact point - or many if the given address resolves to multiple | |
| 807 | 807 | * <code>InetAddress</code>s (A records). |
| 808 | 808 | * <p/> |
| 809 | 809 | * Contact points are addresses of Cassandra nodes that the driver uses |
| @@ -814,7 +814,7 @@ | ||
| 814 | 814 | * the driver cannot initialize itself correctly. |
| 815 | 815 | * <p/> |
| 816 | 816 | * Note that by default (that is, unless you use the {@link #withLoadBalancingPolicy}) |
| 817 | - * method of this builder), the first succesfully contacted host will be used | |
| 817 | + * method of this builder), the first successfully contacted host will be used | |
| 818 | 818 | * to define the local data-center for the client. If follows that if you are |
| 819 | 819 | * running Cassandra in a multiple data-center setting, it is a good idea to |
| 820 | 820 | * only provide contact points that are in the same datacenter than the client, |
| @@ -824,15 +824,15 @@ | ||
| 824 | 824 | * returned will be used. Make sure that all resulting <code>InetAddress</code>s returned |
| 825 | 825 | * point to the same cluster and datacenter. |
| 826 | 826 | * |
| 827 | - * @param address the address of the node(s) to connect to | |
| 827 | + * @param address the address of the node(s) to connect to. | |
| 828 | 828 | * @return this Builder. |
| 829 | - * @throws IllegalArgumentException if no IP address for {@code address} | |
| 830 | - * could be found | |
| 829 | + * @throws IllegalArgumentException if the given {@code address} | |
| 830 | + * could not be resolved. | |
| 831 | 831 | * @throws SecurityException if a security manager is present and |
| 832 | 832 | * permission to resolve the host name is denied. |
| 833 | 833 | */ |
| 834 | 834 | public Builder addContactPoint(String address) { |
| 835 | - // We explicitely check for nulls because InetAdress.getByName() will happily | |
| 835 | + // We explicitly check for nulls because InetAdress.getByName() will happily | |
| 836 | 836 | // accept it and use localhost (while a null here almost likely mean a user error, |
| 837 | 837 | // not "connect to localhost") |
| 838 | 838 | if (address == null) |
| @@ -851,11 +851,14 @@ | ||
| 851 | 851 | * <p/> |
| 852 | 852 | * See {@link Builder#addContactPoint} for more details on contact |
| 853 | 853 | * points. |
| 854 | + * <p/> | |
| 855 | + * Note that all contact points must be resolvable; | |
| 856 | + * if <em>any</em> of them cannot be resolved, this method will fail. | |
| 854 | 857 | * |
| 855 | - * @param addresses addresses of the nodes to add as contact point. | |
| 858 | + * @param addresses addresses of the nodes to add as contact points. | |
| 856 | 859 | * @return this Builder. |
| 857 | - * @throws IllegalArgumentException if no IP address for at least one | |
| 858 | - * of {@code addresses} could be found | |
| 860 | + * @throws IllegalArgumentException if any of the given {@code addresses} | |
| 861 | + * could not be resolved. | |
| 859 | 862 | * @throws SecurityException if a security manager is present and |
| 860 | 863 | * permission to resolve the host name is denied. |
| 861 | 864 | * @see Builder#addContactPoint |
| @@ -871,9 +874,16 @@ | ||
| 871 | 874 | * <p/> |
| 872 | 875 | * See {@link Builder#addContactPoint} for more details on contact |
| 873 | 876 | * points. |
| 877 | + * <p/> | |
| 878 | + * Note that all contact points must be resolvable; | |
| 879 | + * if <em>any</em> of them cannot be resolved, this method will fail. | |
| 874 | 880 | * |
| 875 | - * @param addresses addresses of the nodes to add as contact point. | |
| 881 | + * @param addresses addresses of the nodes to add as contact points. | |
| 876 | 882 | * @return this Builder. |
| 883 | + * @throws IllegalArgumentException if any of the given {@code addresses} | |
| 884 | + * could not be resolved. | |
| 885 | + * @throws SecurityException if a security manager is present and | |
| 886 | + * permission to resolve the host name is denied. | |
| 877 | 887 | * @see Builder#addContactPoint |
| 878 | 888 | */ |
| 879 | 889 | public Builder addContactPoints(InetAddress... addresses) { |
| @@ -887,7 +897,7 @@ | ||
| 887 | 897 | * See {@link Builder#addContactPoint} for more details on contact |
| 888 | 898 | * points. |
| 889 | 899 | * |
| 890 | - * @param addresses addresses of the nodes to add as contact point | |
| 900 | + * @param addresses addresses of the nodes to add as contact points. | |
| 891 | 901 | * @return this Builder |
| 892 | 902 | * @see Builder#addContactPoint |
| 893 | 903 | */ |
| @@ -901,19 +911,19 @@ | ||
| 901 | 911 | * <p/> |
| 902 | 912 | * See {@link Builder#addContactPoint} for more details on contact |
| 903 | 913 | * points. Contrarily to other {@code addContactPoints} methods, this method |
| 904 | - * allow to provide a different port for each contact points. Since Cassandra | |
| 905 | - * nodes must always all listen on the same port, this is rarelly what you | |
| 914 | + * allows to provide a different port for each contact point. Since Cassandra | |
| 915 | + * nodes must always all listen on the same port, this is rarely what you | |
| 906 | 916 | * want and most users should prefer other {@code addContactPoints} methods to |
| 907 | 917 | * this one. However, this can be useful if the Cassandra nodes are behind |
| 908 | 918 | * a router and are not accessed directly. Note that if you are in this |
| 909 | 919 | * situation (Cassandra nodes are behind a router, not directly accessible), |
| 910 | - * you almost surely want to provide a specific {@code AddressTranslator} | |
| 920 | + * you almost surely want to provide a specific {@link AddressTranslator} | |
| 911 | 921 | * (through {@link #withAddressTranslator}) to translate actual Cassandra node |
| 912 | 922 | * addresses to the addresses the driver should use, otherwise the driver |
| 913 | 923 | * will not be able to auto-detect new nodes (and will generally not function |
| 914 | 924 | * optimally). |
| 915 | 925 | * |
| 916 | - * @param addresses addresses of the nodes to add as contact point | |
| 926 | + * @param addresses addresses of the nodes to add as contact points. | |
| 917 | 927 | * @return this Builder |
| 918 | 928 | * @see Builder#addContactPoint |
| 919 | 929 | */ |
| @@ -927,19 +937,19 @@ | ||
| 927 | 937 | * <p/> |
| 928 | 938 | * See {@link Builder#addContactPoint} for more details on contact |
| 929 | 939 | * points. Contrarily to other {@code addContactPoints} methods, this method |
| 930 | - * allow to provide a different port for each contact points. Since Cassandra | |
| 931 | - * nodes must always all listen on the same port, this is rarelly what you | |
| 940 | + * allows to provide a different port for each contact point. Since Cassandra | |
| 941 | + * nodes must always all listen on the same port, this is rarely what you | |
| 932 | 942 | * want and most users should prefer other {@code addContactPoints} methods to |
| 933 | 943 | * this one. However, this can be useful if the Cassandra nodes are behind |
| 934 | 944 | * a router and are not accessed directly. Note that if you are in this |
| 935 | 945 | * situation (Cassandra nodes are behind a router, not directly accessible), |
| 936 | - * you almost surely want to provide a specific {@code AddressTranslator} | |
| 946 | + * you almost surely want to provide a specific {@link AddressTranslator} | |
| 937 | 947 | * (through {@link #withAddressTranslator}) to translate actual Cassandra node |
| 938 | 948 | * addresses to the addresses the driver should use, otherwise the driver |
| 939 | 949 | * will not be able to auto-detect new nodes (and will generally not function |
| 940 | 950 | * optimally). |
| 941 | 951 | * |
| 942 | - * @param addresses addresses of the nodes to add as contact point | |
| 952 | + * @param addresses addresses of the nodes to add as contact points. | |
| 943 | 953 | * @return this Builder |
| 944 | 954 | * @see Builder#addContactPoint |
| 945 | 955 | */ |