git.iko.soy/typeable/bloodhound
on master help sign in
WIP: update index settings
commit9bc7ebdf834ed8e713643c38b8f2af74ef515485 authorMichael Xavier <michael@michaelxavier.net> dateFri 16 Oct 2015, 23:16 (11 years ago) parentb9b4399
2 files changed+43−3
src/Database/Bloodhound/Types.hs+41−1 src/Database/Bloodhound/Types/Class.hs+2−2
src/Database/Bloodhound/Types.hs+41−1
@@ -56,6 +56,7 @@ module Database.Bloodhound.Types
5656 , Existence(..)
5757 , NullValue(..)
5858 , IndexSettings(..)
59+ , IndexSettingUpdate(..)
5960 , IndexTemplate(..)
6061 , Server(..)
6162 , Reply
@@ -245,7 +246,7 @@ import qualified Data.Map.Strict as M
245246import Data.Maybe
246247import Data.Text (Text)
247248import qualified Data.Text as T
248−import Data.Time.Clock (UTCTime)
249+import Data.Time.Clock (UTCTime, NominalDiffTime)
249250import qualified Data.Vector as V
250251import GHC.Enum
251252import GHC.Generics (Generic)
@@ -347,6 +348,45 @@ data IndexSettings =
347348defaultIndexSettings :: IndexSettings
348349defaultIndexSettings = IndexSettings (ShardCount 3) (ReplicaCount 2)
349350
351+data IndexSettingUpdate = NumberOfReplicas Int
352+ | AutoExpandReplicas ReplicaBounds
353+ | BlocksReadOnly Bool
354+ | BlocksRead Bool
355+ | BlocksWrite Bool
356+ | BlocksMetaData Bool
357+ | RefreshInterval NominalDiffTime
358+ | IndexConcurrency Int
359+ | FailOnMergeFailure Bool
360+ | TranslogFlushThresholdOps Int
361+ | TranslogFlushThresholdSize Bytes
362+ | TranslogFlushThresholdPeriod NominalDiffTime
363+ | TranslogDisableFlush Bool
364+ | CacheFilterMaxSize (Maybe Bytes)
365+ | CacheFilterExpire (Maybe NominalDiffTime)
366+ | GatewaySnapshotInterval NominalDiffTime
367+ | RoutingAllocationDisable Bool
368+ | RoutingAllocationDisableNew Bool
369+ | RoutingAllocationDisableReplica Bool
370+ | RoutingAllocationEnable AllocationPolicy
371+ | RoutingAllocationShardsPerNode ShardCount
372+ | RecoveryInitialShards --TODO: shard count or quorum specifications
373+ | GCDeletes
374+ | TTLDisablePurge Bool
375+ | TranslogFSType FSType
376+ | TranslogCompoundFormat
377+ | TranslogCompoundOnFlush
378+ | WarmerEnabled Bool
379+ --TODO: figure out allocation options
380+
381+data AllocationPolicy = AllocAll
382+ | AllocPrimaries
383+ | AllocNewPrimaries
384+ | AllocNone
385+
386+data ReplicaBounds = ReplicasBounded Int Int
387+ | ReplicasLowerBounded Int
388+ | ReplicasUnbounded
389+
350390{-| 'Reply' and 'Method' are type synonyms from 'Network.HTTP.Types.Method.Method' -}
351391type Reply = Network.HTTP.Client.Response L.ByteString
352392type Method = NHTM.Method
src/Database/Bloodhound/Types/Class.hs+2−2
@@ -3,9 +3,9 @@ module Database.Bloodhound.Types.Class
33 ( Seminearring(..) )
44 where
55
6−#if !MIN_VERSION_base(4,8,0)
6+-- #if !MIN_VERSION_base(4,8,0)
77import Data.Monoid
8−#endif
8+-- #endif
99
1010class Monoid a => Seminearring a where
1111 -- 0, +, *