_id
stringlengths
2
7
title
stringclasses
1 value
partition
stringclasses
3 values
text
stringlengths
6
2.61k
language
stringclasses
1 value
meta_information
dict
c26800
train
// lockFiles locks the data and index files of the given file slice. // If files were closed they are opened in this call, and if so, // and if this slice is the write slice, the writer and offset are reset.
{ "resource": "" }
c26801
train
// lockIndexFile locks the index file of the given file slice. // If the file was closed it is opened in this call.
{ "resource": "" }
c26802
train
// unlockIndexFile unlocks the already locked index file of the given file slice.
{ "resource": "" }
c26803
train
// unlockFiles unlocks both data and index files of the given file slice.
{ "resource": "" }
c26804
train
// writeIndex writes a message index record to the writer `w`
{ "resource": "" }
c26805
train
// addIndex adds a message index record in the given buffer
{ "resource": "" }
c26806
train
// readIndex reads a message index record from the given reader // and returns an allocated msgIndex object.
{ "resource": "" }
c26807
train
// processBufferedMsgs adds message index records in the given buffer // for every pending buffered messages.
{ "resource": "" }
c26808
train
// readMsgIndex reads a message index record from disk and returns a msgIndex // object. Same than getMsgIndex but without checking for message in // ms.bufferedMsgs first.
{ "resource": "" }
c26809
train
// removeFirstMsg "removes" the first message of the first slice. // If the slice is "empty" the file slice is removed.
{ "resource": "" }
c26810
train
// removeFirstSlice removes the first file slice. // Should not be called if first slice is also last!
{ "resource": "" }
c26811
train
// getFileSliceForSeq returns the file slice where the message of the // given sequence is stored, or nil if the message is not found in any // of the file slices.
{ "resource": "" }
c26812
train
// backgroundTasks performs some background tasks related to this // messages store.
{ "resource": "" }
c26813
train
// lookup returns the message for the given sequence number, possibly // reading the message from disk. // Store write lock is assumed to be held on entry
{ "resource": "" }
c26814
train
// initCache initializes the message cache
{ "resource": "" }
c26815
train
// add adds a message to the cache. // Store write lock is assumed held on entry
{ "resource": "" }
c26816
train
// get returns a message if available in the cache. // Store write lock is assumed held on entry
{ "resource": "" }
c26817
train
// evict move down the cache maps, evicting the last one. // Store write lock is assumed held on entry
{ "resource": "" }
c26818
train
// empty empties the cache
{ "resource": "" }
c26819
train
// Flush flushes outstanding data into the store.
{ "resource": "" }
c26820
train
// CreateSub records a new subscription represented by SubState. On success, // it returns an id that is used by the other methods.
{ "resource": "" }
c26821
train
// UpdateSub updates a given subscription represented by SubState.
{ "resource": "" }
c26822
train
// shouldCompact returns a boolean indicating if we should compact // Lock is held by caller
{ "resource": "" }
c26823
train
// AddSeqPending adds the given message seqno to the given subscription.
{ "resource": "" }
c26824
train
// AckSeqPending records that the given message seqno has been acknowledged // by the given subscription.
{ "resource": "" }
c26825
train
// compact rewrites all subscriptions on a temporary file, reducing the size // since we get rid of deleted subscriptions and message sequences that have // been acknowledged. On success, the subscriptions file is replaced by this // temporary file. // Lock is held by caller
{ "resource": "" }
c26826
train
// writes a record in the subscriptions file. // store's lock is held on entry.
{ "resource": "" }
c26827
train
// Flush persists buffered operations to disk.
{ "resource": "" }
c26828
train
// Close closes this store
{ "resource": "" }
c26829
train
// Dial creates a new net.Conn with the remote address. This is implemented by // performing a handshake over NATS which establishes unique inboxes at each // endpoint for streaming data.
{ "resource": "" }
c26830
train
// newNATSTransport creates a new raft.NetworkTransport implemented with NATS // as the transport layer.
{ "resource": "" }
c26831
train
// newNATSTransportWithLogger creates a new raft.NetworkTransport implemented // with NATS as the transport layer using the provided Logger.
{ "resource": "" }
c26832
train
// newNATSTransportWithConfig returns a raft.NetworkTransport implemented // with NATS as the transport layer, using the given config struct.
{ "resource": "" }
c26833
train
// expireMsgs ensures that messages don't stay in the log longer than the // limit's MaxAge.
{ "resource": "" }
c26834
train
// removeFirstMsg removes the first message and updates totals.
{ "resource": "" }
c26835
train
// SQLNoCaching sets the NoCaching option
{ "resource": "" }
c26836
train
// SQLMaxOpenConns sets the MaxOpenConns option
{ "resource": "" }
c26837
train
// SQLAllOptions is a convenient option to pass all options from a SQLStoreOptions // structure to the constructor.
{ "resource": "" }
c26838
train
// sqlStmtError returns an error including the text of the offending SQL statement.
{ "resource": "" }
c26839
train
// This go-routine updates the DB store lock at regular intervals.
{ "resource": "" }
c26840
train
// Returns if lock is acquired, the owner and tick value of the lock record.
{ "resource": "" }
c26841
train
// Release the store lock if this store was the owner of the lock
{ "resource": "" }
c26842
train
// Add this store to the list of SubStore needing flushing // and signal the go-routine responsible for flushing if // need be.
{ "resource": "" }
c26843
train
// creates an instance of a SQLMsgStore
{ "resource": "" }
c26844
train
// creates an instance of SQLSubStore
{ "resource": "" }
c26845
train
// initialize the global sqlStmts table to driver's one.
{ "resource": "" }
c26846
train
// Init implements the Store interface
{ "resource": "" }
c26847
train
// Close implements the Store interface
{ "resource": "" }
c26848
train
// GetSequenceFromTimestamp implements the MsgStore interface
{ "resource": "" }
c26849
train
// LastMsg implements the MsgStore interface
{ "resource": "" }
c26850
train
// expireMsgsLocked removes all messages that have expired in this channel. // Store lock is assumed held on entry
{ "resource": "" }
c26851
train
// Flush implements the MsgStore interface
{ "resource": "" }
c26852
train
// UpdateSub implements the SubStore interface
{ "resource": "" }
c26853
train
// DeleteSub implements the SubStore interface
{ "resource": "" }
c26854
train
// This returns the structure responsible to keep track of // pending messages and acks for a given subscription ID.
{ "resource": "" }
c26855
train
// Adds the given sequence to the list of pending messages. // Returns true if the number of pending messages has // reached a certain threshold, indicating that the // store should be flushed.
{ "resource": "" }
c26856
train
// Adds the given sequence to the list of acks and possibly // delete rows that have all their pending messages acknowledged. // Returns true if the number of acks has reached a certain threshold, // indicating that the store should be flushed.
{ "resource": "" }
c26857
train
// AddSeqPending implements the SubStore interface
{ "resource": "" }
c26858
train
// AckSeqPending implements the SubStore interface
{ "resource": "" }
c26859
train
// Flush implements the SubStore interface
{ "resource": "" }
c26860
train
// Close implements the SubStore interface
{ "resource": "" }
c26861
train
// SendsChannelsList sends the list of channels to the given subject, possibly // splitting the list in several requests if it cannot fit in a single message.
{ "resource": "" }
c26862
train
// DecodeChannels decodes from the given byte array the list of channel names // and return them as an array of strings.
{ "resource": "" }
c26863
train
// ftStart will return only when this server has become active // and was able to get the store's exclusive lock. // This is running in a separate go-routine so if server state // changes, take care of using the server's lock.
{ "resource": "" }
c26864
train
// ftGetStoreLock returns true if the server was able to get the // exclusive store lock, false othewise, or if there was a fatal error doing so.
{ "resource": "" }
c26865
train
// ftSendHBLoop is used by an active server to send HB to the FT subject. // Standby servers receiving those HBs do not attempt to lock the store. // When they miss HBs, they will.
{ "resource": "" }
c26866
train
// ftSetup checks that all required FT parameters have been specified and // create the channel required for shutdown. // Note that FTGroupName has to be set before server invokes this function, // so this parameter is not checked here.
{ "resource": "" }
c26867
train
// newClientStore creates a new clientStore instance using `store` as the backing storage.
{ "resource": "" }
c26868
train
// getSubsCopy returns a copy of the client's subscribers array. // At least Read-lock must be held by the caller.
{ "resource": "" }
c26869
train
// Register a new client. Returns ErrInvalidClient if client is already registered.
{ "resource": "" }
c26870
train
// Unregister a client.
{ "resource": "" }
c26871
train
// IsValid returns true if the client is registered, false otherwise.
{ "resource": "" }
c26872
train
// Lookup client by ConnID if not nil, otherwise by clientID. // Assume at least clientStore RLock is held on entry.
{ "resource": "" }
c26873
train
// Lookup a client
{ "resource": "" }
c26874
train
// Lookup a client by connection ID
{ "resource": "" }
c26875
train
// GetSubs returns the list of subscriptions for the client identified by ID, // or nil if such client is not found.
{ "resource": "" }
c26876
train
// AddSub adds the subscription to the client identified by clientID // and returns true only if the client has not been unregistered, // otherwise returns false.
{ "resource": "" }
c26877
train
// RemoveSub removes the subscription from the client identified by clientID // and returns true only if the client has not been unregistered and that // the subscription was found, otherwise returns false.
{ "resource": "" }
c26878
train
// recoverClients recreates the content of the client store based on clients // information recovered from the Store.
{ "resource": "" }
c26879
train
// setClientHB will lookup the client `ID` and, if present, set the // client's timer with the given interval and function.
{ "resource": "" }
c26880
train
// removeClientHB will stop and remove the client's heartbeat timer, if // present.
{ "resource": "" }
c26881
train
// count returns the number of registered clients
{ "resource": "" }
c26882
train
// shutdown attempts to stop the Raft node.
{ "resource": "" }
c26883
train
// createRaftNode creates and starts a new Raft node.
{ "resource": "" }
c26884
train
// bootstrapCluster bootstraps the node for the provided Raft group either as a // seed node or with the given peer configuration, depending on configuration // and with the latter taking precedence.
{ "resource": "" }
c26885
train
// Apply log is invoked once a log entry is committed. // It returns a value which will be made available in the // ApplyFuture returned by Raft.Apply method if that // method was called on the same Raft node as the FSM.
{ "resource": "" }
c26886
train
// EnsureBufBigEnough checks that given buffer is big enough to hold 'needed' // bytes, otherwise returns a buffer of a size of at least 'needed' bytes.
{ "resource": "" }
c26887
train
// CloseFile closes the given file and report the possible error only // if the given error `err` is not already set.
{ "resource": "" }
c26888
train
// FriendlyBytes returns a string with the given bytes int64 // represented as a size, such as 1KB, 10MB, etc...
{ "resource": "" }
c26889
train
// Encrypt returns the encrypted data or an error
{ "resource": "" }
c26890
train
// Decrypt returns the decrypted data or an error
{ "resource": "" }
c26891
train
// NewCryptoStore returns a CryptoStore instance with // given underlying store.
{ "resource": "" }
c26892
train
// Clone returns a copy of the store limits
{ "resource": "" }
c26893
train
// ClonePerChannelMap returns a deep copy of the StoreLimits's PerChannel map
{ "resource": "" }
c26894
train
// Print returns an array of strings suitable for printing the store limits.
{ "resource": "" }
c26895
train
// Create a new job with the time interval.
{ "resource": "" }
c26896
train
//Run the job and immediately reschedule it
{ "resource": "" }
c26897
train
// for given function fn, get the name of function.
{ "resource": "" }
c26898
train
// Specifies the jobFunc that should be called every time the job runs //
{ "resource": "" }
c26899
train
//Compute the instant when this job should run next
{ "resource": "" }