_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c175100
test
// Value returns the value associated with the iterator.
{ "resource": "" }
c175101
test
// Next returns the next element. If it is the same as the current key, ignore it.
{ "resource": "" }
c175102
test
// Seek brings us to element with key >= given key.
{ "resource": "" }
c175103
test
// Close implements y.Iterator
{ "resource": "" }
c175104
test
// Encode encodes Pointer into byte buffer.
{ "resource": "" }
c175105
test
// Decodes h from buf.
{ "resource": "" }
c175106
test
// Encodes e to buf. Returns number of bytes written.
{ "resource": "" }
c175107
test
// SetEntry is the equivalent of Txn.SetEntry.
{ "resource": "" }
c175108
test
// Set is equivalent of Txn.SetWithMeta.
{ "resource": "" }
c175109
test
// SetWithTTL is equivalent of Txn.SetWithTTL.
{ "resource": "" }
c175110
test
// Delete is equivalent of Txn.Delete.
{ "resource": "" }
c175111
test
// Caller to commit must hold a write lock.
{ "resource": "" }
c175112
test
// Flush must be called at the end to ensure that any pending writes get committed to Badger. Flush // returns any error stored by WriteBatch.
{ "resource": "" }
c175113
test
// Error returns any errors encountered so far. No commits would be run once an error is detected.
{ "resource": "" }
c175114
test
// getMemtables returns the current memtables and get references.
{ "resource": "" }
c175115
test
// writeRequests is called serially by only one goroutine.
{ "resource": "" }
c175116
test
// ensureRoomForWrite is always called serially.
{ "resource": "" }
c175117
test
// WriteLevel0Table flushes memtable.
{ "resource": "" }
c175118
test
// handleFlushTask must be run serially.
{ "resource": "" }
c175119
test
// flushMemtable must keep running until we send it an empty flushTask. If there // are errors during handling the flush task, we'll retry indefinitely.
{ "resource": "" }
c175120
test
// This function does a filewalk, calculates the size of vlog and sst files and stores it in // y.LSMSize and y.VlogSize.
{ "resource": "" }
c175121
test
// Size returns the size of lsm and value log files in bytes. It can be used to decide how often to // call RunValueLogGC.
{ "resource": "" }
c175122
test
// Next would return the next integer in the sequence, updating the lease by running a transaction // if needed.
{ "resource": "" }
c175123
test
// Release the leased sequence to avoid wasted integers. This should be done right // before closing the associated DB. However it is valid to use the sequence after // it was released, causing a new lease with full bandwidth.
{ "resource": "" }
c175124
test
// KeySplits can be used to get rough key ranges to divide up iteration over // the DB.
{ "resource": "" }
c175125
test
// Flatten can be used to force compactions on the LSM tree so all the tables fall on the same // level. This ensures that all the versions of keys are colocated and not split across multiple // levels, which is necessary after a restore from backup. During Flatten, live compactions are // stopped. Ideally, no writes a...
{ "resource": "" }
c175126
test
// Mmap uses the mmap system call to memory-map a file. If writable is true, // memory protection of the pages is set so that they may be written to as well.
{ "resource": "" }
c175127
test
// Madvise uses the madvise system call to give advise about the use of memory // when using a slice that is memory-mapped to a file. Set the readahead flag to // false if page references are expected in random order.
{ "resource": "" }
c175128
test
// Any deleted or invalid versions at or below ts would be discarded during // compaction to reclaim disk space in LSM tree and thence value log.
{ "resource": "" }
c175129
test
// hasConflict must be called while having a lock.
{ "resource": "" }
c175130
test
// Set adds a key-value pair to the database. // // It will return ErrReadOnlyTxn if update flag was set to false when creating the // transaction. // // The current transaction keeps a reference to the key and val byte slice // arguments. Users must not modify key and val until the end of the transaction.
{ "resource": "" }
c175131
test
// SetWithMeta adds a key-value pair to the database, along with a metadata // byte. // // This byte is stored alongside the key, and can be used as an aid to // interpret the value or store other contextual bits corresponding to the // key-value pair. // // The current transaction keeps a reference to the key and val ...
{ "resource": "" }
c175132
test
// Delete deletes a key. // // This is done by adding a delete marker for the key at commit timestamp. Any // reads happening before this timestamp would be unaffected. Any reads after // this commit would see the deletion. // // The current transaction keeps a reference to the key byte slice argument. // Users must n...
{ "resource": "" }
c175133
test
// Get looks for key and returns corresponding Item. // If key is not found, ErrKeyNotFound is returned.
{ "resource": "" }
c175134
test
// CommitWith acts like Commit, but takes a callback, which gets run via a // goroutine to avoid blocking this function. The callback is guaranteed to run, // so it is safe to increment sync.WaitGroup before calling CommitWith, and // decrementing it in the callback; to block until all callbacks are run.
{ "resource": "" }
c175135
test
// View executes a function creating and managing a read-only transaction for the user. Error // returned by the function is relayed by the View method. // If View is used with managed transactions, it would assume a read timestamp of MaxUint64.
{ "resource": "" }
c175136
test
// Update executes a function, creating and managing a read-write transaction // for the user. Error returned by the function is relayed by the Update method. // Update cannot be used with managed transactions.
{ "resource": "" }
c175137
test
// Seek brings us to the first block element that is >= input key.
{ "resource": "" }
c175138
test
// SeekToLast brings us to the last element. Valid should return true.
{ "resource": "" }
c175139
test
// parseKV would allocate a new byte slice for key and for value.
{ "resource": "" }
c175140
test
// NewIterator returns a new iterator of the Table
{ "resource": "" }
c175141
test
// seekFrom brings us to a key that is >= input key.
{ "resource": "" }
c175142
test
// seekForPrev will reset iterator and seek to <= key.
{ "resource": "" }
c175143
test
// Value follows the y.Iterator interface
{ "resource": "" }
c175144
test
// Seek follows the y.Iterator interface
{ "resource": "" }
c175145
test
// NewConcatIterator creates a new concatenated iterator
{ "resource": "" }
c175146
test
// Valid implements y.Interface
{ "resource": "" }
c175147
test
// Next advances our concat iterator.
{ "resource": "" }
c175148
test
// Close implements y.Interface.
{ "resource": "" }
c175149
test
// OpenExistingFile opens an existing file, errors if it doesn't exist.
{ "resource": "" }
c175150
test
// Copy copies a byte slice and returns the copied slice.
{ "resource": "" }
c175151
test
// KeyWithTs generates a new key by appending ts to key.
{ "resource": "" }
c175152
test
// ParseTs parses the timestamp from the key bytes.
{ "resource": "" }
c175153
test
// ParseKey parses the actual key from the key bytes.
{ "resource": "" }
c175154
test
// SameKey checks for key equality ignoring the version timestamp suffix.
{ "resource": "" }
c175155
test
// FixedDuration returns a string representation of the given duration with the // hours, minutes, and seconds.
{ "resource": "" }
c175156
test
// NewCloser constructs a new Closer, with an initial count on the WaitGroup.
{ "resource": "" }
c175157
test
// NewThrottle creates a new throttle with a max number of workers.
{ "resource": "" }
c175158
test
// Do should be called by workers before they start working. It blocks if there // are already maximum number of workers working. If it detects an error from // previously Done workers, it would return it.
{ "resource": "" }
c175159
test
// Done should be called by workers when they finish working. They can also // pass the error status of work done.
{ "resource": "" }
c175160
test
// Finish waits until all workers have finished working. It would return any // error passed by Done.
{ "resource": "" }
c175161
test
// SetDiscardTs sets a timestamp at or below which, any invalid or deleted // versions can be discarded from the LSM tree, and thence from the value log to // reclaim disk space. Can only be used with managed transactions.
{ "resource": "" }
c175162
test
// openReadOnly assumes that we have a write lock on logFile.
{ "resource": "" }
c175163
test
// iterate iterates over log file. It doesn't not allocate new memory for every kv pair. // Therefore, the kv pair is only valid for the duration of fn call.
{ "resource": "" }
c175164
test
// sortedFids returns the file id's not pending deletion, sorted. Assumes we have shared access to // filesMap.
{ "resource": "" }
c175165
test
// write is thread-unsafe by design and should not be called concurrently.
{ "resource": "" }
c175166
test
// populateDiscardStats populates vlog.lfDiscardStats // This function will be called while initializing valueLog
{ "resource": "" }
c175167
test
// Backup is a wrapper function over Stream.Backup to generate full and incremental backups of the // DB. For more control over how many goroutines are used to generate the backup, or if you wish to // backup only a certain range of keys, use Stream.Backup directly.
{ "resource": "" }
c175168
test
// ToList is a default implementation of KeyToList. It picks up all valid versions of the key, // skipping over deleted or expired keys.
{ "resource": "" }
c175169
test
// keyRange is [start, end), including start, excluding end. Do ensure that the start, // end byte slices are owned by keyRange struct.
{ "resource": "" }
c175170
test
// produceKVs picks up ranges from rangeCh, generates KV lists and sends them to kvChan.
{ "resource": "" }
c175171
test
// Orchestrate runs Stream. It picks up ranges from the SSTables, then runs NumGo number of // goroutines to iterate over these ranges and batch up KVs in lists. It concurrently runs a single // goroutine to pick these lists, batch them up further and send to Output.Send. Orchestrate also // spits logs out to Infof, us...
{ "resource": "" }
c175172
test
// NewStreamAt creates a new Stream at a particular timestamp. Should only be used with managed DB.
{ "resource": "" }
c175173
test
// DecrRef decrements the refcount and possibly deletes the table
{ "resource": "" }
c175174
test
// ParseFileID reads the file id out of a filename.
{ "resource": "" }
c175175
test
// PrintHistogram builds and displays the key-value size histogram. // When keyPrefix is set, only the keys that have prefix "keyPrefix" are // considered for creating the histogram
{ "resource": "" }
c175176
test
// newSizeHistogram returns a new instance of keyValueSizeHistogram with // properly initialized fields.
{ "resource": "" }
c175177
test
// buildHistogram builds the key-value size histogram. // When keyPrefix is set, only the keys that have prefix "keyPrefix" are // considered for creating the histogram
{ "resource": "" }
c175178
test
// printHistogram prints the histogram data in a human-readable format.
{ "resource": "" }
c175179
test
// Init initializes a WaterMark struct. MUST be called before using it.
{ "resource": "" }
c175180
test
// Begin sets the last index to the given value.
{ "resource": "" }
c175181
test
// BeginMany works like Begin but accepts multiple indices.
{ "resource": "" }
c175182
test
// Done sets a single index as done.
{ "resource": "" }
c175183
test
// DoneMany works like Done but accepts multiple indices.
{ "resource": "" }
c175184
test
// SetDoneUntil sets the maximum index that has the property that all indices // less than or equal to it are done.
{ "resource": "" }
c175185
test
// WaitForMark waits until the given index is marked as done.
{ "resource": "" }
c175186
test
// Encode encodes the header.
{ "resource": "" }
c175187
test
// Decode decodes the header.
{ "resource": "" }
c175188
test
// NewTableBuilder makes a new TableBuilder.
{ "resource": "" }
c175189
test
// keyDiff returns a suffix of newKey that is different from b.baseKey.
{ "resource": "" }
c175190
test
// Add adds a key-value pair to the block. // If doNotRestart is true, we will not restart even if b.counter >= restartInterval.
{ "resource": "" }
c175191
test
// blockIndex generates the block index for the table. // It is mainly a list of all the block base offsets.
{ "resource": "" }
c175192
test
// Finish finishes the table by appending the index.
{ "resource": "" }
c175193
test
// Errorf logs an ERROR log message to the logger specified in opts or to the // global logger if no logger is specified in opts.
{ "resource": "" }
c175194
test
// Infof logs an INFO message to the logger specified in opts.
{ "resource": "" }
c175195
test
// DecrRef decrements the refcount, deallocating the Skiplist when done using it
{ "resource": "" }
c175196
test
// NewSkiplist makes a new empty skiplist, with a given arena size
{ "resource": "" }
c175197
test
// Put inserts the key-value pair.
{ "resource": "" }
c175198
test
// Get gets the value associated with the key. It returns a valid value if it finds equal or earlier // version of the same key.
{ "resource": "" }
c175199
test
// Key returns the key at the current position.
{ "resource": "" }