goimports cleanup
This commit is contained in:
@@ -3,10 +3,11 @@ package rep
|
||||
import (
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"git.crumpington.com/public/jldb/lib/errs"
|
||||
"net"
|
||||
"path/filepath"
|
||||
"time"
|
||||
|
||||
"git.crumpington.com/public/jldb/lib/errs"
|
||||
)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -4,12 +4,13 @@ import (
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"git.crumpington.com/public/jldb/lib/errs"
|
||||
"git.crumpington.com/public/jldb/lib/httpconn"
|
||||
"git.crumpington.com/public/jldb/lib/wal"
|
||||
"net"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"git.crumpington.com/public/jldb/lib/errs"
|
||||
"git.crumpington.com/public/jldb/lib/httpconn"
|
||||
"git.crumpington.com/public/jldb/lib/wal"
|
||||
)
|
||||
|
||||
type client struct {
|
||||
|
||||
@@ -2,10 +2,11 @@ package rep
|
||||
|
||||
import (
|
||||
"crypto/subtle"
|
||||
"git.crumpington.com/public/jldb/lib/httpconn"
|
||||
"log"
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"git.crumpington.com/public/jldb/lib/httpconn"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -54,6 +55,7 @@ func (rep *Replicator) Handle(w http.ResponseWriter, r *http.Request) {
|
||||
switch cmd[0] {
|
||||
|
||||
case cmdGetInfo:
|
||||
|
||||
if err := sendJSON(rep.Info(), conn, rep.conf.NetTimeout); err != nil {
|
||||
logf("Failed to send info: %s", err)
|
||||
return
|
||||
@@ -69,6 +71,7 @@ func (rep *Replicator) Handle(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
|
||||
case cmdStreamWAL:
|
||||
|
||||
err := rep.wal.Send(conn, rep.conf.NetTimeout)
|
||||
if !rep.stopped() {
|
||||
logf("Failed when sending WAL: %s", err)
|
||||
|
||||
@@ -2,9 +2,10 @@ package rep
|
||||
|
||||
import (
|
||||
"io"
|
||||
"git.crumpington.com/public/jldb/lib/errs"
|
||||
"net"
|
||||
"time"
|
||||
|
||||
"git.crumpington.com/public/jldb/lib/errs"
|
||||
)
|
||||
|
||||
func (rep *Replicator) sendState(conn net.Conn) error {
|
||||
|
||||
@@ -1,12 +1,13 @@
|
||||
package rep
|
||||
|
||||
import (
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"git.crumpington.com/public/jldb/lib/atomicheader"
|
||||
"git.crumpington.com/public/jldb/lib/errs"
|
||||
"git.crumpington.com/public/jldb/lib/flock"
|
||||
"git.crumpington.com/public/jldb/lib/wal"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
func (rep *Replicator) loadConfigDefaults() {
|
||||
|
||||
@@ -2,14 +2,15 @@ package rep
|
||||
|
||||
import (
|
||||
"io"
|
||||
"git.crumpington.com/public/jldb/lib/atomicheader"
|
||||
"git.crumpington.com/public/jldb/lib/errs"
|
||||
"git.crumpington.com/public/jldb/lib/wal"
|
||||
"net"
|
||||
"os"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"time"
|
||||
|
||||
"git.crumpington.com/public/jldb/lib/atomicheader"
|
||||
"git.crumpington.com/public/jldb/lib/errs"
|
||||
"git.crumpington.com/public/jldb/lib/wal"
|
||||
)
|
||||
|
||||
type Config struct {
|
||||
@@ -161,10 +162,6 @@ func (rep *Replicator) Primary() bool {
|
||||
return rep.conf.Primary
|
||||
}
|
||||
|
||||
// TODO: Probably remove this.
|
||||
// The caller may call Ack after Apply to acknowledge that the change has also
|
||||
// been applied to the caller's application. Alternatively, the caller may use
|
||||
// follow to apply changes to their application state.
|
||||
func (rep *Replicator) ack(seqNum, timestampMS int64) error {
|
||||
state := rep.getState()
|
||||
state.SeqNum = seqNum
|
||||
|
||||
@@ -5,12 +5,13 @@ import (
|
||||
"encoding/binary"
|
||||
"encoding/json"
|
||||
"io"
|
||||
"git.crumpington.com/public/jldb/lib/wal"
|
||||
"math/rand"
|
||||
"net"
|
||||
"sync"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"git.crumpington.com/public/jldb/lib/wal"
|
||||
)
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user