Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
QubitPi committed Sep 15, 2017
1 parent 244a3fd commit df2da33
Show file tree
Hide file tree
Showing 11 changed files with 52 additions and 43 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Current

### Added:

- [Add Code Narc to validate Groovy style](https://github.com/yahoo/fili/pull/420)
* Checkstyle is great, but it doesn't process Groovy. Code Narc is Checkstyle for Groovy, so we should totally use
it.

- [Enable search provider to hot-swap index and key value store to hot-swap store location](https://github.com/yahoo/fili/pull/522)
* Add new default method to [`SearchProvider`](./fili-core/src/main/java/com/yahoo/bard/webservice/data/dimension/SearchProvider.java)
interface in order to support hot-swapping index.
Expand Down Expand Up @@ -38,7 +42,7 @@ Current

- [Add Table-wide Availability](https://github.com/yahoo/fili/pull/414)
* Add `availableIntervals` field to tables endpoint by union the availability for the logical table without taking
the TablesApiRequest into account.
the TablesApiRequest into account.

- [Implement EtagCacheRequestHandler](https://github.com/yahoo/fili/pull/312)
* Add `EtagCacheRequestHandler` that checks the cache for a matching eTag
Expand All @@ -47,7 +51,7 @@ Current

- [Implement EtagCacheResponseProcessor](https://github.com/yahoo/fili/pull/311)
* Add `EtagCacheResponseProcessor` that caches the results if appropriate after completing a query according to
etag value.
etag value.

- [Add dimension dictionary to metric loader](https://github.com/yahoo/fili/pull/317)
* Added a two argument version of `loadMetricDictionary` default method in `MetricLoader` interface that allows dimension
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import static com.yahoo.bard.webservice.async.jobs.jobrows.DefaultJobField.STATU
import static com.yahoo.bard.webservice.async.jobs.jobrows.DefaultJobField.USER_ID

import com.yahoo.bard.webservice.application.JerseyTestBinder

import com.yahoo.bard.webservice.util.GroovyTestUtils
import com.yahoo.bard.webservice.util.JsonSlurper

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
// Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms.
package com.yahoo.bard.webservice.async.jobs.stores

import com.yahoo.bard.webservice.async.jobs.stores.JobRowFilter
import com.yahoo.bard.webservice.web.BadFilterException
import com.yahoo.bard.webservice.web.FilterOperation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import org.apache.lucene.store.FSDirectory

import java.nio.file.Files
import java.nio.file.Path

/**
* Specification for behavior specific to the LuceneSearchProvider
*/
Expand Down Expand Up @@ -239,24 +238,37 @@ class LuceneSearchProviderSpec extends SearchProviderSpec<LuceneSearchProvider>
Throwable cause = null

@Override
public void run() {
try {
DimensionRow dimensionRow3new = BardDimensionField.makeDimensionRow(
keyValueStoreDimension,
"kumquat",
"this is still not an animal"
)
DimensionRow dimensionRow4 = BardDimensionField.makeDimensionRow(
keyValueStoreDimension,
"badger",
"Badger badger badger badger mushroom mushroom badger badger badger"
)
keyValueStoreDimension.addDimensionRow(dimensionRow3new)
Thread.sleep(100)
keyValueStoreDimension.addDimensionRow(dimensionRow4)
} catch (Throwable t) {
cause = t
}
void run() {
DimensionRow dimensionRow3new = BardDimensionField.makeDimensionRow(
keyValueStoreDimension,
"kumquat",
"this is still not an animal"
)
DimensionRow dimensionRow4 = BardDimensionField.makeDimensionRow(
keyValueStoreDimension,
"badger",
"Badger badger badger badger mushroom mushroom badger badger badger"
)
keyValueStoreDimension.addDimensionRow(dimensionRow3new)
Thread.sleep(100)
keyValueStoreDimension.addDimensionRow(dimensionRow4)
// try {
// DimensionRow dimensionRow3new = BardDimensionField.makeDimensionRow(
// keyValueStoreDimension,
// "kumquat",
// "this is still not an animal"
// )
// DimensionRow dimensionRow4 = BardDimensionField.makeDimensionRow(
// keyValueStoreDimension,
// "badger",
// "Badger badger badger badger mushroom mushroom badger badger badger"
// )
// keyValueStoreDimension.addDimensionRow(dimensionRow3new)
// Thread.sleep(100)
// keyValueStoreDimension.addDimensionRow(dimensionRow4)
// } catch (Throwable t) {
// cause = t
// }
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import static com.yahoo.bard.webservice.data.config.names.TestDruidTableName.MON
import com.yahoo.bard.webservice.web.endpoints.BaseDataServletComponentSpec
import com.yahoo.bard.webservice.web.endpoints.DataServlet

import org.joda.time.DateTime
import org.joda.time.Interval

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms.
package com.yahoo.bard.webservice.util

import com.yahoo.bard.webservice.util.FilterTokenizer

import spock.lang.Specification
import spock.lang.Unroll

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class RateLimitFilterSpec extends Specification {
break

default:
assert false
fail
}
}
}
Expand Down Expand Up @@ -266,7 +266,7 @@ class RateLimitFilterSpec extends Specification {
fail.incrementAndGet()
break
default:
assert false
fail
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,13 +186,12 @@ class WeightCheckRequestHandlerSpec extends Specification {
"""
JsonParser parser = new JsonFactory().createParser(weightResponse)
JsonNode jsonResult = MAPPER.readTree(parser)
1 * next.handleRequest(context, request, groupByQuery, response)

when:
success.invoke(jsonResult)

then:
1 == 1
1 * next.handleRequest(context, request, groupByQuery, response)
}

def "Test build and invoke success callback count too high"() {
Expand All @@ -217,15 +216,15 @@ class WeightCheckRequestHandlerSpec extends Specification {
"""
JsonParser parser = new JsonFactory().createParser(weightResponse)
JsonNode jsonResult = new ObjectMapper().readTree(parser)
0 * next.handleRequest(context, request, groupByQuery, response)
HttpErrorCallback ec = Mock(HttpErrorCallback)
1 * response.getErrorCallback(groupByQuery) >> ec
1 * ec.dispatch(507, _, _)

when:
success.invoke(jsonResult)

then:
1 == 1
0 * next.handleRequest(context, request, groupByQuery, response)
1 * response.getErrorCallback(groupByQuery) >> ec
1 * ec.dispatch(507, _, _)
}

def "Test build and invoke success callback invalid json"() {
Expand All @@ -250,15 +249,14 @@ class WeightCheckRequestHandlerSpec extends Specification {
"""
JsonParser parser = new JsonFactory().createParser(weightResponse)
JsonNode jsonResult = new ObjectMapper().readTree(parser)
0 * next.handleRequest(context, request, groupByQuery, response)
FailureCallback fc = Mock(FailureCallback)
1 * response.getFailureCallback(groupByQuery) >> fc
1 * fc.dispatch(_)

when:
success.invoke(jsonResult)

then:
1 == 1
0 * next.handleRequest(context, request, groupByQuery, response)
1 * response.getFailureCallback(groupByQuery) >> fc
1 * fc.dispatch(_)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
// Licensed under the terms of the Apache license. Please see LICENSE.md file distributed with this work for terms.
package com.yahoo.bard.webservice.web.handlers.workflow

import com.yahoo.bard.webservice.web.handlers.WeightCheckRequestHandler

import static com.yahoo.bard.webservice.config.BardFeatureFlag.DRUID_CACHE
import static com.yahoo.bard.webservice.config.BardFeatureFlag.DRUID_CACHE_V2
import static com.yahoo.bard.webservice.config.BardFeatureFlag.QUERY_SPLIT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ class MappingResponseProcessorSpec extends Specification{

MappingResponseProcessor buildSimpleMRP() {
return new MappingResponseProcessor(apiRequest, objectMappers) {
public FailureCallback getFailureCallback(DruidAggregationQuery<?> query) {return null;}
public HttpErrorCallback getErrorCallback(DruidAggregationQuery<?> query) {return null;}
public void processResponse(JsonNode json, DruidAggregationQuery<?> query, LoggingContext metadata) {}
FailureCallback getFailureCallback(DruidAggregationQuery<?> query) {return null}
HttpErrorCallback getErrorCallback(DruidAggregationQuery<?> query) {return null}
void processResponse(JsonNode json, DruidAggregationQuery<?> query, LoggingContext metadata) {return}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import com.fasterxml.jackson.databind.ObjectMapper

import spock.lang.Specification

public class AutomaticDruidConfigLoadTaskSpec extends Specification {
class AutomaticDruidConfigLoaderSpec extends Specification {
TestDruidWebService druidWebService
DruidNavigator druidNavigator
private String[] metrics = ["count", "added", "deleted", "delta", "user_unique"]
Expand Down

0 comments on commit df2da33

Please sign in to comment.