Package com.datastax.driver.core

Examples of com.datastax.driver.core.Session$Manager


        Long periodicity = 100L;
        Long rowKey = (Long.valueOf(evTime)/periodicity)*periodicity;
        String query = select().all().from(db, table).where(eq("key", String.valueOf(rowKey))).and(eq("column1",Long.valueOf(evTime)))
                .getQueryString();
        Cluster cluster = Cluster.builder().addContactPoints("localhost").build();
        Session session = cluster.connect(db);
        ResultSet rs = session.execute(query);
        return convertResultSet(rs);
    }
View Full Code Here


          new PlainTextAuthProvider(cassandraKijiURI.getUsername(), cassandraKijiURI.getPassword())
      );
    }

    final Cluster cluster = clusterBuilder.build();
    final Session cassandraSession = cluster.connect();
    return new DefaultCassandraAdmin(cassandraSession, kijiURI);
  }
View Full Code Here

        if (!classInformation.getSchema().equals("")) {
            getTemplate(classInformation.getSchema());

        }
        KeySpaceInformation key = classInformation.getKeySpace(getKeySpace());
        Session session = getCluster().connect(key.getKeySpace());
        return fixColumnFamily(session, familyColumn, entity);
  }
View Full Code Here

        if (!classInformation.getSchema().equals("")) {
            getTemplate(classInformation.getSchema());

        }
        KeySpaceInformation key = classInformation.getKeySpace(getKeySpace());
        Session session = getCluster().connect(key.getKeySpace());
        classes.add(class1);
        return fixColumnFamily(session, familyColumn, class1);
    }
View Full Code Here

    @Override
    public Persistence getPersistence(String keySpace) {

        if (!persistenceMap.containsKey(keySpace)) {
            Session session = getSession();
            if (!keySpaces.contains(keySpace)) {
                verifyKeySpace(keySpace, getSession());
                keySpaces.add(keySpace);
            }
            persistenceMap.put(keySpace, new PersistenceSimpleImpl(session,
View Full Code Here

    public Persistence getPersistence(String host, String keySpace,
            ReplicaStrategy replicaStrategy, int factor) {

        if (!persistenceMap.containsKey(keySpace)) {
            Cluster cluter = Cluster.builder().addContactPoints(host).build();
            Session session = cluter.connect();
            if (!keySpace.contains(keySpace)) {
                verifyKeySpace(keySpace, cluter.connect(), replicaStrategy, factor);
                keySpaces.add(keySpace);
            }
            persistenceMap.put(keySpace, new PersistenceSimpleImpl(session,
View Full Code Here

            getPersistence(classInformation.getSchema());

        }
        classes.add(class1);
        KeySpaceInformation key = classInformation.getKeySpace(keySpace);
        Session session = getCluster().connect(key.getKeySpace());
        return new FixColumnFamily().verifyColumnFamily(session, key.getKeySpace(),
                key.getColumnFamily(), class1);
    }
View Full Code Here

    // PersistenceSession handling
    //
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    @Override public Session driverSession() {
        Session s = session;
        if (s == null) {
            throw new PersistenceRuntimeException("not connected");
        }
        return s;
    }
View Full Code Here

            if (!changed) {
                return null;
            }

            Session session = driverSession();
            BoundStatement bStmt = entity.updateBoundStatement(statementOptions, session, instance, binder);
            ExecutionTracer tracer = executionTracer(PersistenceSessionTrackingImpl.this, entity);
            return new ModifyFutureImpl<T>(PersistenceSessionTrackingImpl.this, tracer, null, session.executeAsync(bStmt), entity, instance,
                PersistMode.UPDATE);
        }
View Full Code Here

    public PersistenceManager build() {
        if (model == null) {
            throw new NullPointerException();
        }

        Session s = session;
        boolean mySession = s == null;
        if (s == null && cluster != null) {
            s = cluster.connect();
        }
View Full Code Here

TOP

Related Classes of com.datastax.driver.core.Session$Manager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.