!"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~Memcached Types(c) David Terei, 2016BSDcode@davidterei.comstableGHCNoneMemcached response packet.FThe status (success or error) of a Memcached operation returned in a . Operation successful. Key not found. Key exists when not expected. #Value too large to store at server.  Invalid arguments for operation.5Key-Value pair not stored at server (internal error).8Value not numeric when increment or decrement requested.&Server doesn't know requested command.Server out of memory.SASL authentication failed.(SASL authentication requires more steps.KNRaw request is custom requests, dangerous as no corresponding raw response...]"Memcached packet header (for both * and ).fPassword for authentication.gUsername for authentication.h-SASL Authentication information for a server.n Noop request.oNoop response.p  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqn  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^e_`abcdfghijklmnonhijklgfWXYTUVSRQPONML ]^_`abcdemZ[\*+,-.789:;<=>?@ABCDEFGHIJK563412/0n !"#$%&'()o  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqErrors Handling(c) David Terei, 2016BSDcode@davidterei.comstableGHCNone0;Errors related to Memcached protocol and bytes on the wire.$Received an unknown response packet.Unknown Memcached operation.%Unknown Memcached status field value.?Unexpected length of a Memcached field (extras, key, or value).;Response packet is for a different operation than expected.5Network socket closed without receiving enough bytes. Errors that occur on the client.(All servers are currently marked failed.+Timeout occurred sending request to server.1All exceptions that a Memcached client may throw.Memcached operation error.Error occuring on client side.5Errors occurring communicating with Memcached server.Convert a status to  exception.Create a properly formatted  protocol error. "  Connection Handling(c) David Terei, 2016BSDcode@davidterei.comstableGHCNone'Send a request to the Memcached server.hRetrieve a single response from the Memcached server. FIXME: read into buffer to minimize read syscalls9Check whether we can still operate on this socket or not.-Serialize a response to a ByteString Builder.,Serialize a request to a ByteString Builder.'Deserialize a Header from a ByteString.Deserialize a Response body.9Deserialize the body of a Response that contains nothing.@Deserialize the body of a Get Response (Extras [flags] & Value).GDeserialize the body of a GetK Response (Extras [flags] & Key & Value).>Deserialize the body of a Incr/Decr Response (Value [Word64]).UDeserialize the body of a general response that just has a value (no key or extras).VDeserialize the body of a general response that just has a key and value (no extras).#Deserialize a Response status code.dCheck the length of a header field is as expected, throwing a ProtocolError exception if it is not.*+,-.*+,-.SASL Authentication(c) David Terei, 2016BSDcode@davidterei.comstableGHCNone,Perform SASL authentication with the server."Perform SASL PLAIN authentication.List available SASL authentication methods. We could call this but as we only support PLAIN as does the Memcached server, we simply assume PLAIN authentication is supprted and try that.fghijklhijklgfServer Handling(c) David Terei, 2016BSDcode@davidterei.comstableGHCNone!" Memcached server connection.$ID of server for consistent hashing.Connection pool to server.Hostname of server.Port number of server.Credentials for server.+When did the server fail? 0 if it is alive.)Create a new Memcached server connection.HSend and receive a single request/response pair to the Memcached server.9Run a function with access to an server socket for using  and .qClose the server connection. If you perform another operation after this, the connection will be re-established. Cluster Handling(c) David Terei, 2016BSDcode@davidterei.comstableGHCNone!"9;TMemcached cluster. microseconds microseconds?Options specifies how a Memcached cluster should be configured.Number of times to retry an operation on failure. If consecutive failures exceed this value for a server, we mark it as down and failover to a different server for the next operation. Default is 2.[After an operation has failed, how long to wait before retrying it while still within the  count?Default is 200ms.UHow long to wait after a server has been marked down, before trying to use it again.Default is 1500ms.LHow long to wait for an operation to complete before considering it failed.Default is 750ms.;ServerSpec specifies a server configuration for connection.!Hostname of server to connect to.!Port number server is running on.GAuthentication values to use for SASL authentication with this server.CNumber of times to retry an operation before considering it failed.;Establish a new connection to a group of Memcached servers.Check if server is alive.Figure out which server to talk to for this key. I.e., the distribution method. We use consistent hashing based on the CHORD approach.Run a Memcached operation against a particular server, handling any failures that occur, retrying the specified number of times.Run a Memcached operation against a particular server, handling any failures that occur, retrying the specified number of times.Run a Memcached operation against any single server in the cluster, handling any failures that occur, retrying the specified number of times.Run a Memcached operation against all servers in the cluster, handling any failures that occur, retrying the specified number of times.Run a Memcached operation against all servers in the cluster, handling any failures that occur, retrying the specified number of times. Similar to / but allows more flexible interaction with the % than a single request and response.Run an IO operation multiple times if an exception is thrown, marking the server as dead if it fails more than the allowed number of retries.Memcached Client(c) David Terei, 2016BSDcode@davidterei.comstableGHCNone*StatResults are a list of key-value pairs.CA Memcached client, connected to a collection of Memcached servers.;Establish a new connection to a group of Memcached servers.5Gracefully close a connection to a Memcached cluster.4Retrieve the value for the given key from Memcached.Get-and-touch: Retrieve the value for the given key from Memcached, and also update the stored key-value pairs expiration time at the server. Use an expiration value of 0 to store forever.uUpdate the expiration time of a stored key-value pair, returning its version identifier. Use an expiration value of 0 to store forever.sStore a new (or overwrite exisiting) key-value pair, returning its version identifier. Use an expiration value of 0 to store forever.Store a key-value pair, but only if the version specified by the client matches the Version of the key-value pair at the server. The version identifier of the stored key-value pair is returned, or if the version match fails, Nothing) is returned. Use an expiration value of 0 to store forever.xStore a new key-value pair, returning it's version identifier. If the key-value pair already exists, then fail (return ). Use an expiration value of 0 to store forever.Update the value of an existing key-value pair, returning it's new version identifier. If the key doesn't already exist, the fail and return Nothing. Use an expiration value of 0 to store forever.Increment a numeric value stored against a key, returning the incremented value and the version identifier of the key-value pair. Use an expiration value of 0 to store forever.Decrement a numeric value stored against a key, returning the decremented value and the version identifier of the key-value pair. Use an expiration value of 0 to store forever.zAppend a value to an existing key-value pair, returning the new version identifier of the key-value pair when successful.{Prepend a value to an existing key-value pair, returning the new version identifier of the key-value pair when successful.DDelete a key-value pair at the server, returning true if successful.Remove (delete) all currently stored key-value pairs from the cluster. The expiration value can be used to cause this flush to occur in the future rather than immediately.Return statistics on the stored key-value pairs at each server in the cluster. The optional key can be used to select a different set of statistics from the server than the default. Most Memcached servers support "items", "slabs" or  "settings".Version returns the version string of the Memcached cluster. We just query one server and assume all servers in the cluster are the same version.A fghijklFhijklgf    !"#$%&'()*+,-./0123456789:;;<<==>>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdeefghijklmnopqrstuvwxyz{|}~l'memcache-0.2.0.1-BKF3oP1sM0O7aun9EiWFyVDatabase.Memcache.ClientDatabase.Memcache.SocketDatabase.Memcache.TypesDatabase.Memcache.ErrorsDatabase.Memcache.SASLDatabase.Memcache.ServerDatabase.Memcache.Cluster1data-default-class-0.1.2.0-FYQpjIylblBDctdkHAFeXAData.Default.Classdef&network-2.6.3.1-G4Up1CPKbp7DeFsnywOnGGNetwork.Socket.TypesSocketResponseResresOp resStatus resOpaqueresCasStatusNoErrorErrKeyNotFound ErrKeyExistsErrValueTooLargeErrInvalidArgsErrItemNotStoredErrValueNonNumericErrUnknownCommandErrOutOfMemory SaslAuthFailSaslAuthContinue OpResponseResGetResGetKResSetResAdd ResReplace ResDelete ResIncrement ResDecrement ResAppend ResPrependResTouchResGATResGATKResFlushResNoop ResVersionResStatResQuit ResSASLList ResSASLStart ResSASLStepRequestReqreqOp reqOpaquereqCasSERawSETouchSEIncrSESet OpRequestReqGetReqSetReqAdd ReqReplace ReqDelete ReqIncrement ReqDecrement ReqAppend ReqPrependReqTouchReqGATReqFlushReqNoop ReqVersionReqStatReqQuit ReqSASLList ReqSASLStart ReqSASLStepReqRawVersionFlags ExpirationDeltaInitialExtrasValueKeyKNoKey IncludeKeyQLoudQuietPktType PktRequest PktResponseHeaderopkeyLenextraLenstatusbodyLenopaquecasPasswordUsernameAuthenticationAuthNoAuthusernamepasswordmEMCACHE_HEADER_SIZEemptyReqemptyRes $fEqSERaw $fShowSERaw$fEqAuthentication$fShowAuthentication $fEqPktType $fShowPktType$fEqQ$fShowQ$fEqK$fShowK $fEqSESet $fShowSESet $fEqSEIncr $fShowSEIncr $fEqSETouch $fShowSETouch $fEqOpRequest$fShowOpRequest $fEqRequest $fShowRequest$fEqOpResponse$fShowOpResponse $fEqStatus $fShowStatus $fEqHeader $fShowHeader $fEqResponse$fShowResponse ProtocolError UnknownPkt UnknownOp UnknownStatus BadLengthWrongOp UnexpectedEOF protocolError ClientErrorNoServersReadyTimeout MemcacheErrorOpError throwStatuswrongOp$fExceptionMemcacheError$fEqClientError$fShowClientError$fEqProtocolError$fShowProtocolError$fEqMemcacheError$fShowMemcacheErrorsendrecv szResponse szRequestdzHeader dzResponse authenticateServersidfailed newServersendRecv withSocketclose $fOrdServer $fEqServer $fShowServerClusterOptionsoptsServerRetriesoptsFailRetryDelayoptsDeadRetryDelayoptsServerTimeout ServerSpecssHostssPortssAuthRetries newClusterkeyedOpanyOpallOpallOp'$fDefaultOptions$fDefaultServerSpec$fEqServerSpec$fShowServerSpec $fEqOptions $fShowOptions $fEqCluster $fShowCluster StatResultsClient newClientquitgetgattouchsetaddreplace increment decrementappendprependdeleteflushstatsversionisSocketActivedzGenericResponse dzGetResponsedzGetKResponsedzNumericResponsedzValueResponsedzKeyValueResponsedzStatus chkLength szOpResponse szOpRequest saslAuthPlain saslListMechspooladdrportauthsSTRIPES sCONNECTIONS sKEEPALIVE cFailDelaycTimeout serverAlivegetServerForKeyserverOpretryOpcServerscRetries cDeadDelaybaseGHC.BaseNothing