_id
stringlengths
2
7
text
stringlengths
6
2.61k
title
stringclasses
1 value
c175200
// Value returns value.
c175201
// Next advances to the next position.
c175202
// Prev advances to the previous position.
c175203
// Seek advances to the first entry with a key >= target.
c175204
// SeekForPrev finds an entry with key <= target.
c175205
// NewUniIterator returns a UniIterator.
c175206
// Next implements y.Interface
c175207
// Seek implements y.Interface
c175208
// asChanges returns a sequence of changes that could be used to recreate the Manifest in its // present state.
c175209
// Must be called while appendLock is held.
c175210
// Check does some sanity check on one level of data or in-memory index.
c175211
// AcquireDirectoryLock acquires exclusive access to a directory.
c175212
// Release removes the directory lock.
c175213
// AssertTruef is AssertTrue with extra info.
c175214
// Wrapf is Wrap with extra info.
c175215
// initTables replaces s.tables with given tables. This is done during loading.
c175216
// deleteTables remove tables idx0, ..., idx1-1.
c175217
// tryAddLevel0Table returns true if ok and no stalling.
c175218
// getTableForKey acquires a read-lock to access s.tables. It returns a list of tableHandlers.
c175219
// get returns value for a given key or the key after that. If not found, return nil.
c175220
// overlappingTables returns the tables that intersect with key range. Returns a half-interval. // This function should already have acquired a read lock, and this is so important the caller must // pass an empty parameter declaring such.
c175221
// String returns a string representation of Item
c175222
// KeyCopy returns a copy of the key of the item, writing it to dst slice. // If nil is passed, or capacity of dst isn't sufficient, a new slice would be allocated and // returned.
c175223
// ValueSize returns the exact size of the value. // // This can be called to quickly estimate the size of a value without fetching // it.
c175224
// NewKeyIterator is just like NewIterator, but allows the user to iterate over all versions of a // single key. Internally, it sets the Prefix option in provided opt, and uses that prefix to // additionally run bloom filter lookups before picking tables from the LSM tree.
c175225
// Valid returns false when iteration is done.
c175226
// ValidForPrefix returns false when iteration is done // or when the current key is not prefixed by the specified prefix.
c175227
// Close would close the iterator. It is important to call this when you're done with iteration.
c175228
// parseItem is a complex function because it needs to handle both forward and reverse iteration // implementation. We store keys such that their versions are sorted in descending order. This makes // forward iteration efficient, but revese iteration complicated. This tradeoff is better because // forward iteration is ...
c175229
// Seek would seek to the provided key if present. If absent, it would seek to the next smallest key // greater than the provided key if iterating in the forward direction. Behavior would be reversed if // iterating backwards.
c175230
// GetMergeOperator creates a new MergeOperator for a given key and returns a // pointer to it. It also fires off a goroutine that performs a compaction using // the merge function that runs periodically, as specified by dur.
c175231
// Get returns the latest value for the merge operator, which is derived by // applying the merge function to all the values added so far. // // If Add has not been called even once, Get will return ErrKeyNotFound.
c175232
// compareAndAdd will check whether we can run this compactDef. That it doesn't overlap with any // other running compaction. If it can be run, it would store this run in the compactStatus state.
c175233
// newArena returns a new arena.
c175234
// putNode allocates a node in the arena. The node is aligned on a pointer-sized // boundary. The arena offset of the node is returned.
c175235
// getNode returns a pointer to the node located at offset. If the offset is // zero, then the nil node pointer is returned.
c175236
// getKey returns byte slice at offset.
c175237
// getVal returns byte slice at offset. The given size should be just the value // size and should NOT include the meta bytes.
c175238
// getNodeOffset returns the offset of node in the arena. If the node pointer is // nil, then the zero offset is returned.
c175239
// These variables are global and have cumulative values for all kv stores.
c175240
// revertToManifest checks that all necessary table files exist and removes all table files not // referenced by the manifest. idMap is a set of table file id's that were read from the directory // listing.
c175241
// dropTree picks all tables from all levels, creates a manifest changeset, // applies it, and then decrements the refs of these tables, which would result // in their deletion.
c175242
// dropPrefix runs a L0->L1 compaction, and then runs same level compaction on the rest of the // levels. For L0->L1 compaction, it runs compactions normally, but skips over all the keys with the // provided prefix. For Li->Li compactions, it picks up the tables which would have the prefix. The // tables who only have ...
c175243
// Returns true if level zero may be compacted, without accounting for compactions that already // might be happening.
c175244
// doCompact picks some table on level l and compacts it away to the next level.
c175245
// get returns the found value if any. If not found, we return nil.
c175246
// seekTotal retrives the total of all accounts by seeking for each account key.
c175247
// Range is [lowTs, highTs).
c175248
// Create replaces the stored snapshot with a new one using the given args
c175249
// List returns the latest snapshot taken
c175250
// Open wraps an io.ReadCloser around the snapshot contents
c175251
// Write appends the given bytes to the snapshot contents
c175252
// NewFileSnapshotStoreWithLogger creates a new FileSnapshotStore based // on a base directory. The `retain` parameter controls how many // snapshots are retained. Must be at least 1.
c175253
// NewFileSnapshotStore creates a new FileSnapshotStore based // on a base directory. The `retain` parameter controls how many // snapshots are retained. Must be at least 1.
c175254
// snapshotName generates a name for the snapshot.
c175255
// Create is used to start a new snapshot
c175256
// List returns available snapshots in the store.
c175257
// getSnapshots returns all the known snapshots.
c175258
// readMeta is used to read the meta data for a given named backup
c175259
// Open takes a snapshot ID and returns a ReadCloser for that snapshot.
c175260
// ReapSnapshots reaps any snapshots beyond the retain count.
c175261
// Write is used to append to the state file. We write to the // buffered IO object to reduce the amount of context switches.
c175262
// Close is used to indicate a successful end.
c175263
// Cancel is used to indicate an unsuccessful end.
c175264
// finalize is used to close all of our resources.
c175265
// writeMeta is used to write out the metadata we have.
c175266
// NewNetworkTransportWithConfig creates a new network transport with the given config struct
c175267
// setupStreamContext is used to create a new stream context. This should be // called with the stream lock held.
c175268
// getStreamContext is used retrieve the current stream context.
c175269
// SetHeartbeatHandler is used to setup a heartbeat handler // as a fast-pass. This is to avoid head-of-line blocking from // disk IO.
c175270
// CloseStreams closes the current streams.
c175271
// Close is used to stop the network transport.
c175272
// getExistingConn is used to grab a pooled connection.
c175273
// getConnFromAddressProvider returns a connection from the server address provider if available, or defaults to a connection using the target server address
c175274
// getConn is used to get a connection from the pool.
c175275
// returnConn returns a connection back to the pool.
c175276
// listen is used to handling incoming connections.
c175277
// handleConn is used to handle an inbound connection for its lifespan. The // handler will exit when the passed context is cancelled or the connection is // closed.
c175278
// handleCommand is used to decode and dispatch a single command.
c175279
// decodeResponse is used to decode an RPC response and reports whether // the connection can be reused.
c175280
// sendRPC is used to encode and send the RPC.
c175281
// newNetPipeline is used to construct a netPipeline from a given // transport and connection.
c175282
// decodeResponses is a long running routine that decodes the responses // sent on the connection.
c175283
// AppendEntries is used to pipeline a new append entries request.
c175284
// Closed is used to shutdown the pipeline connection.
c175285
// NewObserver creates a new observer that can be registered // to make observations on a Raft instance. Observations // will be sent on the given channel if they satisfy the // given filter. // // If blocking is true, the observer will block when it can't // send on the channel, otherwise it may discard events.
c175286
// RegisterObserver registers a new observer.
c175287
// DeregisterObserver deregisters an observer.
c175288
// observe sends an observation to every observer.
c175289
// NewInmemStore returns a new in-memory backend. Do not ever // use for production. Only for testing.
c175290
// FirstIndex implements the LogStore interface.
c175291
// LastIndex implements the LogStore interface.
c175292
// GetLog implements the LogStore interface.
c175293
// StoreLog implements the LogStore interface.
c175294
// StoreLogs implements the LogStore interface.
c175295
// DeleteRange implements the LogStore interface.
c175296
// Set implements the StableStore interface.
c175297
// Get implements the StableStore interface.
c175298
// SetUint64 implements the StableStore interface.
c175299
// GetUint64 implements the StableStore interface.