Tabnine Logo
Memtable
Code IndexAdd Tabnine to your IDE (free)

How to use
Memtable
in
org.apache.cassandra.db

Best Java code snippets using org.apache.cassandra.db.Memtable (Showing top 20 results out of 315)

origin: jsevellec/cassandra-unit

public boolean isEmpty()
{
  return sstables.isEmpty()
      && liveMemtables.size() <= 1
      && flushingMemtables.size() == 0
      && (liveMemtables.size() == 0 || liveMemtables.get(0).getOperations() == 0);
}
origin: com.strapdata.cassandra/cassandra-all

  public Void call()
  {
    cfs.data.reset(new Memtable(new AtomicReference<>(CommitLogPosition.NONE), cfs));
    return null;
  }
}, true, false);
origin: com.facebook.presto.cassandra/cassandra-server

public Memtable getMemtableFor(OpOrder.Group opGroup, ReplayPosition replayPosition)
{
  // since any new memtables appended to the list after we fetch it will be for operations started
  // after us, we can safely assume that we will always find the memtable that 'accepts' us;
  // if the barrier for any memtable is set whilst we are reading the list, it must accept us.
  // there may be multiple memtables in the list that would 'accept' us, however we only ever choose
  // the oldest such memtable, as accepts() only prevents us falling behind (i.e. ensures we don't
  // assign operations to a memtable that was retired/queued before we started)
  for (Memtable memtable : view.get().liveMemtables)
  {
    if (memtable.accepts(opGroup, replayPosition))
      return memtable;
  }
  throw new AssertionError(view.get().liveMemtables.toString());
}
origin: org.apache.cassandra/cassandra-all

  protected void runMayThrow()
  {
    synchronized (data)
    {
      Memtable current = data.getView().getCurrentMemtable();
      // if we're not expired, we've been hit by a scheduled flush for an already flushed memtable, so ignore
      if (current.isExpired())
      {
        if (current.isClean())
        {
          // if we're still clean, instead of swapping just reschedule a flush for later
          scheduleFlush();
        }
        else
        {
          // we'll be rescheduled by the constructor of the Memtable.
          forceFlush();
        }
      }
    }
  }
};
origin: org.apache.cassandra/cassandra-all

  public void adjustMemtableSize(long additionalSpace, OpOrder.Group opGroup)
  {
    baseCfs.getTracker().getView().getCurrentMemtable().getAllocator().onHeap().allocate(additionalSpace, opGroup);
  }
};
origin: org.apache.cassandra/cassandra-all

public Collection<SSTableReader> flushMemtable(Memtable memtable, boolean flushNonCf2i)
  if (memtable.isClean() || truncate)
      flushRunnables = memtable.flushRunnables(txn);
      t = memtable.abortRunnables(flushRunnables, t);
      t = txn.abort(t);
      throw Throwables.propagate(t);
origin: org.apache.cassandra/cassandra-all

Memtable newMemtable = new Memtable(commitLogUpperBound, cfs);
Memtable oldMemtable = cfs.data.switchMemtable(truncate, newMemtable);
oldMemtable.setDiscarding(writeBarrier, commitLogUpperBound);
memtables.add(oldMemtable);
origin: org.apache.cassandra/cassandra-all

  public Long getValue()
  {
    return cfs.getTracker().getView().getCurrentMemtable().getLiveDataSize();
  }
});
origin: org.apache.cassandra/cassandra-all

  public Long getValue()
  {
    long memtablePartitions = 0;
    for (Memtable memtable : cfs.getTracker().getView().getAllMemtables())
      memtablePartitions += memtable.partitionCount();
    return SSTableReader.getApproximateKeyCount(cfs.getSSTables(SSTableSet.CANONICAL)) + memtablePartitions;
  }
});
origin: jsevellec/cassandra-unit

  public void runMayThrow()
  {
    readBarrier.await();
    memtable.setDiscarded();
  }
}, reclaimExecutor);
origin: com.facebook.presto.cassandra/cassandra-server

public boolean isCleanAfter(ReplayPosition position)
{
  return isClean() || (position != null && minReplayPosition.compareTo(position) >= 0);
}
origin: com.facebook.presto.cassandra/cassandra-server

/**
 * Insert/Update the column family for this key.
 * Caller is responsible for acquiring Keyspace.switchLock
 * param @ lock - lock that needs to be used.
 * param @ key - key for update/insert
 * param @ columnFamily - columnFamily changes
 */
public void apply(DecoratedKey key, ColumnFamily columnFamily, SecondaryIndexManager.Updater indexer, OpOrder.Group opGroup, ReplayPosition replayPosition)
{
  long start = System.nanoTime();
  Memtable mt = data.getMemtableFor(opGroup, replayPosition);
  final long timeDelta = mt.put(key, columnFamily, indexer, opGroup);
  maybeUpdateRowCache(key);
  metric.samplers.get(Sampler.WRITES).addSample(key.getKey(), key.hashCode(), 1);
  metric.writeLatency.addNano(System.nanoTime() - start);
  if(timeDelta < Long.MAX_VALUE)
    metric.colUpdateTimeDeltaHistogram.update(timeDelta);
}
origin: com.facebook.presto.cassandra/cassandra-server

if (memtable.isClean() || truncate)
  MoreExecutors.sameThreadExecutor().execute(memtable.flushRunnable());
  reclaim(memtable);
origin: jsevellec/cassandra-unit

  public Long getValue()
  {
    return cfs.getTracker().getView().getCurrentMemtable().getAllocator().onHeap().owns();
  }
});
origin: com.strapdata.cassandra/cassandra-all

public Collection<SSTableReader> flushMemtable(Memtable memtable, boolean flushNonCf2i)
  if (memtable.isClean() || truncate)
      flushRunnables = memtable.flushRunnables(txn);
      t = memtable.abortRunnables(flushRunnables, t);
      t = txn.abort(t);
      throw Throwables.propagate(t);
origin: jsevellec/cassandra-unit

  protected void runMayThrow()
  {
    synchronized (data)
    {
      Memtable current = data.getView().getCurrentMemtable();
      // if we're not expired, we've been hit by a scheduled flush for an already flushed memtable, so ignore
      if (current.isExpired())
      {
        if (current.isClean())
        {
          // if we're still clean, instead of swapping just reschedule a flush for later
          scheduleFlush();
        }
        else
        {
          // we'll be rescheduled by the constructor of the Memtable.
          forceFlush();
        }
      }
    }
  }
};
origin: jsevellec/cassandra-unit

Memtable newMemtable = new Memtable(commitLogUpperBound, cfs);
Memtable oldMemtable = cfs.data.switchMemtable(truncate, newMemtable);
oldMemtable.setDiscarding(writeBarrier, commitLogUpperBound);
memtables.add(oldMemtable);
origin: jsevellec/cassandra-unit

  public Long getValue()
  {
    return cfs.getTracker().getView().getCurrentMemtable().getLiveDataSize();
  }
});
origin: jsevellec/cassandra-unit

  public Long getValue()
  {
    long memtablePartitions = 0;
    for (Memtable memtable : cfs.getTracker().getView().getAllMemtables())
      memtablePartitions += memtable.partitionCount();
    return SSTableReader.getApproximateKeyCount(cfs.getSSTables(SSTableSet.CANONICAL)) + memtablePartitions;
  }
});
origin: com.strapdata.cassandra/cassandra-all

  public void runMayThrow()
  {
    readBarrier.await();
    memtable.setDiscarded();
  }
}, reclaimExecutor);
org.apache.cassandra.dbMemtable

Most used methods

  • getOperations
  • <init>
  • accepts
  • getAllocator
  • getLiveDataSize
  • isClean
  • isExpired
  • partitionCount
  • put
    Should only be called by ColumnFamilyStore.apply via Keyspace.apply, which supplies the appropriate
  • setDiscarded
  • setDiscarding
  • toString
  • setDiscarding,
  • toString,
  • abortRunnables,
  • createFlushRunnables,
  • findMinLocalDeletionTime,
  • flushRunnables,
  • getCommitLogLowerBound,
  • getCommitLogUpperBound,
  • getMinTimestamp,
  • getPartition

Popular in Java

  • Updating database using SQL prepared statement
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • getSupportFragmentManager (FragmentActivity)
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now