Class CassandraStorage.Builder
- java.lang.Object
-
- zipkin2.storage.StorageComponent.Builder
-
- zipkin2.storage.cassandra.internal.CassandraStorageBuilder<CassandraStorage.Builder>
-
- zipkin2.storage.cassandra.v1.CassandraStorage.Builder
-
- Enclosing class:
- CassandraStorage
public static final class CassandraStorage.Builder extends zipkin2.storage.cassandra.internal.CassandraStorageBuilder<CassandraStorage.Builder>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CassandraStorage
build()
CassandraStorage.Builder
ensureSchema(boolean ensureSchema)
Ensures that schema exists, if enabled tries to execute: io.zipkin.zipkin2:zipkin-storage-cassandra-v1/cassandra-schema.cql Defaults to true.CassandraStorage.Builder
indexCacheMax(int indexCacheMax)
Indicates the maximum trace index metadata entries to cache.CassandraStorage.Builder
indexCacheTtl(int indexCacheTtl)
Indicates how long in seconds to cache trace index metadata.CassandraStorage.Builder
indexTtl(int indexTtl)
Deprecated.current schema uses default ttls.CassandraStorage.Builder
keyspace(String keyspace)
Keyspace to store span and index data.CassandraStorage.Builder
sessionFactory(SessionFactory sessionFactory)
Override to control how sessions are created.CassandraStorage.Builder
spanTtl(int spanTtl)
Deprecated.current schema uses default ttls.
-
-
-
Method Detail
-
keyspace
public CassandraStorage.Builder keyspace(String keyspace)
Keyspace to store span and index data. Defaults to "zipkin"- Overrides:
keyspace
in classzipkin2.storage.cassandra.internal.CassandraStorageBuilder<CassandraStorage.Builder>
-
ensureSchema
public CassandraStorage.Builder ensureSchema(boolean ensureSchema)
Ensures that schema exists, if enabled tries to execute:- io.zipkin.zipkin2:zipkin-storage-cassandra-v1/cassandra-schema.cql
- Overrides:
ensureSchema
in classzipkin2.storage.cassandra.internal.CassandraStorageBuilder<CassandraStorage.Builder>
-
sessionFactory
public CassandraStorage.Builder sessionFactory(SessionFactory sessionFactory)
Override to control how sessions are created.
-
spanTtl
@Deprecated public CassandraStorage.Builder spanTtl(int spanTtl)
Deprecated.current schema uses default ttls. This parameter will be removed in Zipkin 2Time-to-live in seconds for span data. Defaults to 604800 (7 days)
-
indexTtl
@Deprecated public CassandraStorage.Builder indexTtl(int indexTtl)
Deprecated.current schema uses default ttls. This parameter will be removed in Zipkin 2Time-to-live in seconds for index data. Defaults to 259200 (3 days)
-
indexCacheMax
public CassandraStorage.Builder indexCacheMax(int indexCacheMax)
Indicates the maximum trace index metadata entries to cache. Zero disables the feature. Defaults to 100000.This is used to obviate redundant inserts into
Tables.SERVICE_NAME_INDEX
,Tables.SERVICE_REMOTE_SERVICE_NAME_INDEX
,Tables.SERVICE_SPAN_NAME_INDEX
andTables.ANNOTATIONS_INDEX
.Corresponds to the count of rows inserted into between
indexCacheTtl
and now. This is bounded so that collectors that get large trace volume don't run out of memory beforeindexCacheTtl
passes.Note: It is hard to estimate precisely how many is the right number, particularly as annotations and tag values are included in partition keys (meaning each cache entry can vary in size considerably). A good guess might be 5 x spans per indexCacheTtl, memory permitting.
-
indexCacheTtl
public CassandraStorage.Builder indexCacheTtl(int indexCacheTtl)
Indicates how long in seconds to cache trace index metadata. Defaults to 1 minute. This is only read whenindexCacheMax
is greater than zero.You should pick a value that is longer than the gap between the root span's timestamp and its latest descendant span's timestamp. More simply, if 95% of your trace durations are under 1 minute, use 1 minute.
-
build
public CassandraStorage build()
- Specified by:
build
in classStorageComponent.Builder
-
-