Przeglądaj źródła

Merge remote-tracking branch 'origin/master' into fix-panic

Conflicts:
	AUTHORS
Oliver Beattie 10 lat temu
rodzic
commit
111a338b2e
2 zmienionych plików z 3 dodań i 0 usunięć
  1. 1 0
      AUTHORS
  2. 2 0
      cluster.go

+ 1 - 0
AUTHORS

@@ -41,4 +41,5 @@ Dmitriy Fedorenko <c0va23@gmail.com>
 Zach Marcantel <zmarcantel@gmail.com>
 James Maloney <jamessagan@gmail.com>
 Ashwin Purohit <purohit@gmail.com>
+Dan Kinder <dkinder.is.me@gmail.com>
 Oliver Beattie <oliver@obeattie.com>

+ 2 - 0
cluster.go

@@ -71,6 +71,7 @@ type ClusterConfig struct {
 	ConnPoolType     NewPoolFunc   // The function used to create the connection pool for the session (default: NewSimplePool)
 	DiscoverHosts    bool          // If set, gocql will attempt to automatically discover other members of the Cassandra cluster (default: false)
 	MaxPreparedStmts int           // Sets the maximum cache size for prepared statements globally for gocql (default: 1000)
+	PageSize         int           // Default page size to use for created sessions (default: 0)
 	Discovery        DiscoveryConfig
 	SslOpts          *SslOptions
 }
@@ -112,6 +113,7 @@ func (cfg *ClusterConfig) CreateSession() (*Session, error) {
 	if pool.Size() > 0 {
 		s := NewSession(pool, *cfg)
 		s.SetConsistency(cfg.Consistency)
+		s.SetPageSize(cfg.PageSize)
 
 		if cfg.DiscoverHosts {
 			hostSource := &ringDescriber{