Skip to content

Commit

Permalink
Remove some dead code
Browse files Browse the repository at this point in the history
Differential Revision: D68156212

fbshipit-source-id: 6a18c526e47b8f9586f47f57563703bac8bf320b
  • Loading branch information
Simon Marlow authored and facebook-github-bot committed Jan 15, 2025
1 parent a19e363 commit 3aec7fa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 42 deletions.
28 changes: 0 additions & 28 deletions glean/db/Glean/Database/Writes.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
module Glean.Database.Writes
( enqueueBatch
, enqueueJsonBatch
, enqueueJsonBatchByteString
, enqueueCheckpoint
, pollBatch
, reapWrites
Expand All @@ -48,7 +47,6 @@ import Control.Monad
import Control.Monad.Extra (whenM)
import Control.Trace (traceMsg)
import qualified Data.ByteString as ByteString
import Data.ByteString (ByteString)
import Data.Default
import Data.Either
import Data.HashMap.Strict (HashMap)
Expand Down Expand Up @@ -345,32 +343,6 @@ enqueueJsonBatch env repo batch = do
when (sendJsonBatch_remember batch) $ rememberWrite env handle write
return $ def { sendJsonBatchResponse_handle = handle }

-- | Version of enqueueJsonBatch where the facts are ByteStrings. This
-- is to avoid unnecessary ByteString->Text->ByteString conversion
-- when reading from Scribe.
--
-- TODO: this could go away if we could get Thrift to use ByteString
-- as the representation for string, then we could just use
-- enqueueJsonBatch.
--
enqueueJsonBatchByteString
:: Env
-> Repo
-> PredicateRef
-> [ByteString] -- ^ facts
-> SendJsonBatchOptions
-> Bool -- ^ remember?
-> IO Thrift.SendJsonBatchResponse
enqueueJsonBatchByteString env repo pred facts opts remember = do
let
size = sum (map ByteString.length facts)
traceMsg (envTracer env) (GleanTraceEnqueue repo EnqueueJsonBatchBS size) $ do
handle <- UUID.toText <$> UUID.nextRandom
write <- enqueueWrite env repo size $
writeJsonBatchByteString env repo pred facts opts
when remember $ rememberWrite env handle write
return $ def { sendJsonBatchResponse_handle = handle }

pollBatch :: Env -> Handle -> IO FinishResponse
pollBatch env@Env{..} handle = do
r <- HashMap.lookup handle <$> readTVarIO envWrites
Expand Down
14 changes: 0 additions & 14 deletions glean/db/Glean/Write/JSON.hs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ module Glean.Write.JSON
( buildJsonBatch
, syncWriteJsonBatch
, writeJsonBatch
, writeJsonBatchByteString
) where

import Control.Exception hiding (catch, throw)
Expand Down Expand Up @@ -99,19 +98,6 @@ buildJsonBatch dbSchema opts batches =
writeFacts dbSchema (fromMaybe def opts) builders
jsonFactBatch_predicate jsonFactBatch_facts jsonFactBatch_unit

writeJsonBatchByteString
:: Env
-> Repo
-> PredicateRef
-> [ByteString] -- ^ facts
-> SendJsonBatchOptions
-> IO WriteContent
writeJsonBatchByteString env repo pred facts opts = do
dbSchema <- withOpenDatabase env repo (return . Database.odbSchema)
emptySubst $ withFactBuilder $ \builder ->
writeFacts dbSchema opts builder pred facts Nothing{-TODO-}


writeFacts
:: DbSchema
-> SendJsonBatchOptions
Expand Down

0 comments on commit 3aec7fa

Please sign in to comment.