Package org.caffinitas.mapper.core.tracing

Examples of org.caffinitas.mapper.core.tracing.ExecutionTracer


            return;
        }

        LOGGER.debug("Received update schema for keyspace {}", keyspaceMetadata.getName());

        ExecutionTracer tracer = executionTracerFactory != null ? executionTracerFactory.getExecutionTracer(null, null) : null;
        if (tracer != null) {
            tracer.onUpdateSchema(this, keyspaceMetadata);
        }

        updateSchemaLock.lock();
        try {

            boolean change = false;

            for (MappedSchemaObject<?> schemaObject : dependencyGraphList) {
                if (!schemaObject.getCqlTable().getKeyspace().equals(keyspaceMetadata.getName()))
                    continue;

                if (schemaObject instanceof MappedCompositeUDT) {
                    @SuppressWarnings("unchecked") UpdateSchemaStatus status =
                        ((MappedSchemaObject<UserType>) schemaObject)
                            .updateSchema(this, keyspaceMetadata.getUserType(schemaObject.getCqlTable().getTable()));
                    if (tracer != null) {
                        tracer.onUpdateSchemaUserType(this, keyspaceMetadata, schemaObject, status);
                    }
                    change |= status.change;
                    if (status.change) {
                        CqlTable t = schemaObject.getCqlTable();
                        LOGGER.info("Changes in Cassandra user type {} successfully applied - exists:{} valid:{}", t, t.isExists(), t.isValid());
                    }
                }
                if (schemaObject instanceof MappedEntityBase) {
                    @SuppressWarnings("unchecked") UpdateSchemaStatus status =
                        ((MappedSchemaObject<TableMetadata>) schemaObject)
                            .updateSchema(this, keyspaceMetadata.getTable(schemaObject.getCqlTable().getTable()));
                    if (tracer != null) {
                        tracer.onUpdateSchemaEntity(this, keyspaceMetadata, schemaObject, status);
                    }
                    change |= status.change;
                    if (status.change) {
                        CqlTable t = schemaObject.getCqlTable();
                        LOGGER.info("Changes in Cassandra user type {} successfully applied - exists:{} valid:{}", t, t.isExists(), t.isValid());
View Full Code Here


                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

            }
        }

        // now the raw primary key of the referenced object is the values[]

        ExecutionTracer tracer = session.executionTracer(session, refEntity);
        ReadOneFutureImpl refFuture = new ReadOneFutureImpl(session, tracer);
        // TODO get persistOptions somehow...
        StatementOptions statementOptions = session.statementOptions;
        PersistOption[] persistOptions = PersistOption.NO_OPTIONS;
        refEntity.executeLoadBoundStatements(tracer, session.driverSession(), values, refFuture, statementOptions, persistOptions);
View Full Code Here

        }
        if (LOGGER.isTraceEnabled()) {
            LOGGER.trace("Submitting bound statement for {} : {}", type, binderAndStatement.statement);
        }
        validate(instance);
        ExecutionTracer tracer = executionTracer(this, entity);
        if (tracer != null) {
            tracer.onBeginModify(this, entity, type, binderAndStatement.statement);
        }
        return new ModifyFutureImpl<T>(this, tracer, binderAndStatement.binder, driverSession().executeAsync(binderAndStatement.statement),
            entity, instance, type);
    }
View Full Code Here

    @SuppressWarnings("unchecked") @Override public <T> ReadOneFuture<T> loadOneWithOptionsAsync(Class<T> type, PersistOption[] options,
                                                                                                 Object... primaryKey) {
        MappedEntityBase entity = loadXPrecheck(type, primaryKey);

        ExecutionTracer tracer = executionTracer(this, entity);
        ReadOneFutureImpl<T> future = new ReadOneFutureImpl<T>(this, tracer);
        entity.executeLoadBoundStatements(tracer, driverSession(), primaryKey, future, statementOptions, options);
        return future;
    }
View Full Code Here

    @SuppressWarnings("unchecked") @Override public <T> ReadFuture<List<T>> loadMultipleWithOptionsAsync(Class<T> type, PersistOption[] options,
                                                                                                         Object... primaryKey) {
        MappedEntityBase entity = loadXPrecheck(type, primaryKey);

        ExecutionTracer tracer = executionTracer(this, entity);
        ReadFutureImpl<T> future = new ReadFutureImpl<T>(this, tracer);
        entity.executeLoadBoundStatements(tracer, driverSession(), primaryKey, future, statementOptions, options);
        return future;
    }
View Full Code Here

    }

    @Override public <T> ReadFuture<List<T>> executeQueryAsync(QueryBinder<T> queryBinder) {
        QueryBinderImpl<T> binderImpl = (QueryBinderImpl<T>) queryBinder;

        ExecutionTracer tracer = executionTracer(this, binderImpl.entity);
        ReadFutureImpl<T> future = new ReadFutureImpl<T>(this, tracer);
        binderImpl.entity.executeQuery(tracer, binderImpl, future);
        return future;
    }
View Full Code Here

        final AtomicBoolean readResultSetBegin = new AtomicBoolean();
        final AtomicBoolean readResultSetRow = new AtomicBoolean();
        final AtomicBoolean readResultSetEnd = new AtomicBoolean();
        final AtomicBoolean modifyWrapResultSet = new AtomicBoolean();

        final ExecutionTracer loggingTracer = new LoggingExecutionTracer(ExecutionTracerTest.class, true);

        ExecutionTracer executionTracer = new AbstractDelegateExecutionTracer() {
            @Override protected ExecutionTracer getDelegate() {
                return loggingTracer;
            }

            @Override public void onBeginModify(PersistenceSession persistenceSession, MappedSchemaObject<?> entity, PersistMode mode,
View Full Code Here

TOP

Related Classes of org.caffinitas.mapper.core.tracing.ExecutionTracer

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.