package com.l7tech.server.cassandra;

import com.datastax.oss.driver.api.core.DriverException;
import com.l7tech.gateway.common.cassandra.CassandraConnection;
import com.l7tech.objectmodel.Goid;
import com.l7tech.objectmodel.UpdateException;
import com.l7tech.util.TimeUnit;

public interface CassandraConnectionManager {
   int MAX_SIMUL_REQ_PER_HOST_LOCAL_DEF = 1024;
   int MAX_CONNECTIONS_PER_LOCAL_HOST_DEFAULT = 1;
   int MAX_CONNECTIONS_PER_REMOTE_HOST_DEFAULT = 1;
   int NUM_OF_USED_HOSTS_PER_REMOTE_DC_DEFAULT = 0;
   boolean ALLOW_REMOTE_DCS_FOR_LOCAL_CONSISTENCY_LEVEL_DEFAULT = false;
   long DEFAULT_CONNECTION_MAX_AGE = 0L;
   long DEFAULT_CONNECTION_MAX_IDLE = TimeUnit.MINUTES.toMillis(30L);
   int DEFAULT_CONNECTION_CACHE_SIZE = 20;
   int DEFAULT_FETCH_SIZE = 5000;
   int DEFAULT_CONNECTION_TIMEOUT_MS = 5000;
   int DEFAULT_READ_TIMEOUT_MS = 12000;
   boolean DEFAULT_KEEP_ALIVE = true;
   boolean DEFAULT_TCP_NO_DELAY = false;
   String PLAIN_TEXT_AUTH_PROVIDER = "PlainTextAuthProvider";

   CassandraConnectionHolder getConnection(String var1);

   void testConnection(CassandraConnection var1) throws DriverException;

   void closeAllConnections();

   void addConnection(CassandraConnection var1);

   void removeConnection(CassandraConnection var1);

   void removeConnection(Goid var1);

   void updateConnection(CassandraConnection var1) throws UpdateException;
}
