@Test( expected = NullPointerException.class ) public void writeParamsNoContext() throws ConnectionException { logEntryStrategy.write( null, mock( MvccLogEntry.class ) ); }
@Override public MutationBatch write( final ApplicationScope collectionScope, final MvccLogEntry entry ) { Preconditions.checkNotNull( collectionScope, "collectionScope is required" ); Preconditions.checkNotNull( entry, "entry is required" ); final Stage stage = entry.getStage(); final UUID colName = entry.getVersion(); final StageStatus stageStatus = new StageStatus( stage, entry.getState() ); return doWrite( collectionScope, entry.getEntityId(), entry.getVersion(), colMutation -> { if ( stage.isTransient() ) { colMutation.putColumn( colName, stageStatus, SER, fig.getTimeout() ); return; } colMutation.putColumn( colName, stageStatus, SER, null ); } ); }
MvccLogEntrySerializationStrategyImpl implements MvccLogEntrySerializationStrategy { @Override public MutationBatch write( final ApplicationScope collectionScope, final MvccLogEntry entry ) { Preconditions.checkNotNull( collectionScope, "collectionScope is required" ); Preconditions.checkNotNull( entry, "entry is required" ); final Stage stage = entry.getStage(); final UUID colName = entry.getVersion(); final StageStatus stageStatus = new StageStatus( stage, entry.getState() ); return doWrite( collectionScope, entry.getEntityId(), entry.getVersion(), colMutation -> { if ( stage.isTransient() ) { colMutation.putColumn( colName, stageStatus, SER, fig.getTimeout() ); return; } colMutation.putColumn( colName, stageStatus, SER, null ); } ); } }
MvccLogEntrySerializationStrategyImpl implements MvccLogEntrySerializationStrategy { @Override public MutationBatch write( final ApplicationScope collectionScope, final MvccLogEntry entry ) { Preconditions.checkNotNull( collectionScope, "collectionScope is required" ); Preconditions.checkNotNull( entry, "entry is required" ); final Stage stage = entry.getStage(); final UUID colName = entry.getVersion(); final StageStatus stageStatus = new StageStatus( stage, entry.getState() ); return doWrite( collectionScope, entry.getEntityId(), entry.getVersion(), colMutation -> { if ( stage.isTransient() ) { colMutation.putColumn( colName, stageStatus, SER, fig.getTimeout() ); return; } colMutation.putColumn( colName, stageStatus, SER, null ); } ); } MvccLogEntrySerializationStrategyImpl( final Keyspace keyspace, final SerializationFig fig ); }
MvccLogEntrySerializationStrategyImpl implements MvccLogEntrySerializationStrategy { @Override public MutationBatch write( final ApplicationScope collectionScope, final MvccLogEntry entry ) { Preconditions.checkNotNull( collectionScope, "collectionScope is required" ); Preconditions.checkNotNull( entry, "entry is required" ); final Stage stage = entry.getStage(); final UUID colName = entry.getVersion(); final StageStatus stageStatus = new StageStatus( stage, entry.getState() ); return doWrite( collectionScope, entry.getEntityId(), entry.getVersion(), colMutation -> { if ( stage.isTransient() ) { colMutation.putColumn( colName, stageStatus, SER, fig.getTimeout() ); return; } colMutation.putColumn( colName, stageStatus, SER, null ); } ); } MvccLogEntrySerializationStrategyImpl( final Keyspace keyspace, final SerializationFig fig ); @Override MutationBatch write( final ApplicationScope collectionScope, final MvccLogEntry entry ); @Override VersionSet load( final ApplicationScope collectionScope, final Collection<Id> entityIds,
                            final UUID maxVersion ); @Override List<MvccLogEntry> load( final ApplicationScope collectionScope, final Id entityId, final UUID version,
                                    final int maxSize ); @Override List<MvccLogEntry> loadReversed( final ApplicationScope applicationScope, final Id entityId,
                                            final UUID minVersion, final int maxSize ); @Override MutationBatch delete( final ApplicationScope context, final Id entityId, final UUID version ); }
MvccLogEntrySerializationStrategyImpl implements MvccLogEntrySerializationStrategy { @Override public MutationBatch write( final ApplicationScope collectionScope, final MvccLogEntry entry ) { Preconditions.checkNotNull( collectionScope, "collectionScope is required" ); Preconditions.checkNotNull( entry, "entry is required" ); final Stage stage = entry.getStage(); final UUID colName = entry.getVersion(); final StageStatus stageStatus = new StageStatus( stage, entry.getState() ); return doWrite( collectionScope, entry.getEntityId(), entry.getVersion(), colMutation -> { if ( stage.isTransient() ) { colMutation.putColumn( colName, stageStatus, SER, fig.getTimeout() ); return; } colMutation.putColumn( colName, stageStatus, SER, null ); } ); } MvccLogEntrySerializationStrategyImpl( final Keyspace keyspace, final SerializationFig fig ); @Override MutationBatch write( final ApplicationScope collectionScope, final MvccLogEntry entry ); @Override VersionSet load( final ApplicationScope collectionScope, final Collection<Id> entityIds,
                            final UUID maxVersion ); @Override List<MvccLogEntry> load( final ApplicationScope collectionScope, final Id entityId, final UUID version,
                                    final int maxSize ); @Override List<MvccLogEntry> loadReversed( final ApplicationScope applicationScope, final Id entityId,
                                            final UUID minVersion, final int maxSize ); @Override MutationBatch delete( final ApplicationScope context, final Id entityId, final UUID version );  }