Merge pull request #239 from bitemyapp/bitemyapp/updatable-index-setting-json-iso

Updatable index setting json iso
This commit is contained in:
Chris Allen 2018-05-06 14:32:38 -05:00 committed by GitHub
commit c71a130f1f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 27 additions and 64 deletions

View File

@ -11,11 +11,6 @@ env:
global:
- JAVA_HOME=/usr/lib/jvm/java-8-oracle
matrix:
- GHCVER=7.8 ESVER=1.3.6 STACK_YAML=stack-7.8.yaml ESFLAG=ES1 DLINK=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch
- GHCVER=7.8 ESVER=1.4.1 STACK_YAML=stack-7.8.yaml ESFLAG=ES1 DLINK=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch
- GHCVER=7.10 ESVER=1.5.2 STACK_YAML=stack-7.10.yaml ESFLAG=ES1 DLINK=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch
- GHCVER=7.10 ESVER=1.6.0 STACK_YAML=stack-7.10.yaml ESFLAG=ES1 DLINK=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch
- GHCVER=7.10 ESVER=1.7.6 STACK_YAML=stack-7.10.yaml ESFLAG=ES1 DLINK=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch
- GHCVER=8.0 ESVER=1.7.6 STACK_YAML=stack-8.0.yaml ESFLAG=ES1 DLINK=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch
- GHCVER=8.0 ESVER=5.0.2 STACK_YAML=stack-8.0.yaml ESFLAG=ES5 DLINK=https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch ES_JAVA_OPTS="-Xms500m -Xmx750m"
- GHCVER=8.2 ESVER=1.7.6 STACK_YAML=stack.yaml ESFLAG=ES1 DLINK=https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch

View File

@ -9,6 +9,7 @@ module Bloodhound.Import
, showText
, deleteSeveral
, oPath
, tshow
) where
import Control.Applicative as X (Alternative (..), optional)

View File

@ -1418,15 +1418,20 @@ data NodeJVMInfo = NodeJVMInfo {
, nodeJVMInfoMemoryInfo :: JVMMemoryInfo
, nodeJVMInfoStartTime :: UTCTime
, nodeJVMInfoVMVendor :: Text
, nodeJVMVMVersion :: VersionNumber
, nodeJVMVMVersion :: VMVersion
-- ^ JVM doesn't seme to follow normal version conventions
, nodeJVMVMName :: Text
, nodeJVMVersion :: VersionNumber
, nodeJVMVersion :: JVMVersion
, nodeJVMPID :: PID
} deriving (Eq, Show)
-- | Handles quirks in the way JVM versions are rendered (1.7.0_101 -> 1.7.0.101)
newtype JVMVersion = JVMVersion { unJVMVersion :: VersionNumber }
-- | We cannot parse JVM version numbers and we're not going to try.
newtype JVMVersion =
JVMVersion { unJVMVersion :: Text }
deriving (Eq, Show)
instance FromJSON JVMVersion where
parseJSON = withText "JVMVersion" (pure . JVMVersion)
data JVMMemoryInfo = JVMMemoryInfo {
jvmMemoryInfoDirectMax :: Bytes
@ -1436,6 +1441,18 @@ data JVMMemoryInfo = JVMMemoryInfo {
, jvmMemoryInfoHeapInit :: Bytes
} deriving (Eq, Show)
-- VM version numbers don't appear to be SemVer
-- so we're special casing this jawn.
newtype VMVersion =
VMVersion { unVMVersion :: Text }
deriving (Eq, Show)
instance ToJSON VMVersion where
toJSON = toJSON . unVMVersion
instance FromJSON VMVersion where
parseJSON = withText "VMVersion" (pure . VMVersion)
newtype JVMMemoryPool = JVMMemoryPool {
jvmMemoryPool :: Text
} deriving (Eq, Show, FromJSON)
@ -2228,14 +2245,9 @@ instance FromJSON NodeJVMInfo where
<*> o .: "vm_vendor"
<*> o .: "vm_version"
<*> o .: "vm_name"
<*> (unJVMVersion <$> o .: "version")
<*> o .: "version"
<*> o .: "pid"
instance FromJSON JVMVersion where
parseJSON (String t) =
JVMVersion <$> parseJSON (String (T.replace "_" "." t))
parseJSON v = JVMVersion <$> parseJSON v
instance FromJSON JVMMemoryInfo where
parseJSON = withObject "JVMMemoryInfo" parse
where

View File

@ -1,21 +0,0 @@
flags:
bloodhound-examples:
werror: true
packages:
- '.'
- './examples'
extra-deps:
- http-client-0.5.0
- aeson-1.2.0.0
- fail-4.9.0.0
- http-types-0.9
- attoparsec-0.13.0.1
- quickcheck-properties-0.1
- semigroups-0.18.3
- uri-bytestring-0.1.9
- temporary-resourcet-0.1.0.0
- transformers-compat-0.5.1.4
- pretty-simple-2.0.2.0
- quickcheck-arbitrary-template-0.2.0.0
resolver: lts-6.12

View File

@ -1,25 +0,0 @@
flags:
aeson:
old-locale: true
bloodhound-examples:
werror: true
packages:
- '.'
- './examples'
extra-deps:
- aeson-0.11.1.0
- fail-4.9.0.0
- http-types-0.9
- http-client-0.5.0
- attoparsec-0.13.0.1
- quickcheck-properties-0.1
- semigroups-0.18.0.1
- tagged-0.8.3
- uri-bytestring-0.1.9
- void-0.7.1
- generics-sop-0.2.2.0
- unordered-containers-0.2.6.0
- pretty-simple-2.0.2.0
- quickcheck-arbitrary-template-0.2.0.0
resolver: lts-2.18

View File

@ -462,9 +462,6 @@ makeArbitrary ''Analysis
instance Arbitrary Analysis where arbitrary = arbitraryAnalysis
makeArbitrary ''Tokenizer
instance Arbitrary Tokenizer where arbitrary = arbitraryTokenizer
makeArbitrary ''UpdatableIndexSetting
instance Arbitrary UpdatableIndexSetting where
arbitrary = arbitraryUpdatableIndexSetting
makeArbitrary ''Compression
instance Arbitrary Compression where arbitrary = arbitraryCompression
makeArbitrary ''Bytes
@ -534,6 +531,10 @@ instance Arbitrary FactorMissingFieldValue where arbitrary = arbitraryFactorMiss
makeArbitrary ''FactorModifier
instance Arbitrary FactorModifier where arbitrary = arbitraryFactorModifier
makeArbitrary ''UpdatableIndexSetting
instance Arbitrary UpdatableIndexSetting where
arbitrary = resize 10 arbitraryUpdatableIndexSetting
newtype UpdatableIndexSetting' =
UpdatableIndexSetting' UpdatableIndexSetting
deriving (Show, Eq, ToJSON, FromJSON, ApproxEq, Typeable)