/** * The configuration that will be used for the new cluster. * * <p>You <b>should not</b> modify this object directly because changes made to the returned * object may not be used by the cluster build. Instead, you should use the other methods of * this {@code Builder}. * * @return the configuration to use for the new cluster. */ @Override public Configuration getConfiguration() { ProtocolOptions protocolOptions = new ProtocolOptions( port, protocolVersion, maxSchemaAgreementWaitSeconds, sslOptions, authProvider, noCompact) .setCompression(compression); MetricsOptions metricsOptions = new MetricsOptions(metricsEnabled, jmxEnabled); return configurationBuilder .withProtocolOptions(protocolOptions) .withMetricsOptions(metricsOptions) .withPolicies(policiesBuilder.build()) .build(); }
void compressionTest(ProtocolOptions.Compression compression) { cluster().getConfiguration().getProtocolOptions().setCompression(compression); try { Session compressedSession = cluster().connect(keyspace); .getConfiguration() .getProtocolOptions() .setCompression(ProtocolOptions.Compression.NONE);
/** * The configuration that will be used for the new cluster. * <p/> * You <b>should not</b> modify this object directly because changes made * to the returned object may not be used by the cluster build. * Instead, you should use the other methods of this {@code Builder}. * * @return the configuration to use for the new cluster. */ @Override public Configuration getConfiguration() { ProtocolOptions protocolOptions = new ProtocolOptions(port, protocolVersion, maxSchemaAgreementWaitSeconds, sslOptions, authProvider) .setCompression(compression); MetricsOptions metricsOptions = new MetricsOptions(metricsEnabled, jmxEnabled); return configurationBuilder .withProtocolOptions(protocolOptions) .withMetricsOptions(metricsOptions) .withPolicies(policiesBuilder.build()) .build(); }
/** * The configuration that will be used for the new cluster. * <p/> * You <b>should not</b> modify this object directly because changes made * to the returned object may not be used by the cluster build. * Instead, you should use the other methods of this {@code Builder}. * * @return the configuration to use for the new cluster. */ @Override public Configuration getConfiguration() { ProtocolOptions protocolOptions = new ProtocolOptions(port, protocolVersion, maxSchemaAgreementWaitSeconds, sslOptions, authProvider) .setCompression(compression); MetricsOptions metricsOptions = new MetricsOptions(metricsEnabled, jmxEnabled); return configurationBuilder .withProtocolOptions(protocolOptions) .withMetricsOptions(metricsOptions) .withPolicies(policiesBuilder.build()) .build(); }
/** * The configuration that will be used for the new cluster. * <p/> * You <b>should not</b> modify this object directly because changes made * to the returned object may not be used by the cluster build. * Instead, you should use the other methods of this {@code Builder}. * * @return the configuration to use for the new cluster. */ @Override public Configuration getConfiguration() { ProtocolOptions protocolOptions = new ProtocolOptions(port, protocolVersion, maxSchemaAgreementWaitSeconds, sslOptions, authProvider) .setCompression(compression); MetricsOptions metricsOptions = new MetricsOptions(metricsEnabled, jmxEnabled); return configurationBuilder .withProtocolOptions(protocolOptions) .withMetricsOptions(metricsOptions) .withPolicies(policiesBuilder.build()) .build(); }
void compressionTest(ProtocolOptions.Compression compression) { cluster().getConfiguration().getProtocolOptions().setCompression(compression); try { Session compressedSession = cluster().connect(keyspace); .getConfiguration() .getProtocolOptions() .setCompression(ProtocolOptions.Compression.NONE);
/** * The configuration that will be used for the new cluster. * <p> * You <b>should not</b> modify this object directly because changes made * to the returned object may not be used by the cluster build. * Instead, you should use the other methods of this {@code Builder}. * * @return the configuration to use for the new cluster. */ @Override public Configuration getConfiguration() { Policies policies = new Policies( loadBalancingPolicy == null ? Policies.defaultLoadBalancingPolicy() : loadBalancingPolicy, reconnectionPolicy == null ? Policies.defaultReconnectionPolicy() : reconnectionPolicy, retryPolicy == null ? Policies.defaultRetryPolicy() : retryPolicy, addressTranslater == null ? Policies.defaultAddressTranslater() : addressTranslater ); return new Configuration(policies, new ProtocolOptions(port, protocolVersion, sslOptions, authProvider).setCompression(compression), poolingOptions == null ? new PoolingOptions() : poolingOptions, socketOptions == null ? new SocketOptions() : socketOptions, metricsEnabled ? new MetricsOptions(jmxEnabled) : null, queryOptions == null ? new QueryOptions() : queryOptions); }