segmentGranularity constants on tranquility

How do i define a segment granularity of 30 minutes on tranquility spec?

it tried this,

“granularitySpec” : {

“type” : “uniform”,

“segmentGranularity” : {“type”: “period”, “period”: “PT30M”},

“queryGranularity” : “none”

}

java.lang.IllegalArgumentException: No enum constant com.metamx.common.Granularity.{
at java.lang.Enum.valueOf(Enum.java:238)
at com.metamx.common.Granularity.valueOf(Granularity.java:41)
at io.druid.jackson.DruidDefaultSerializersModule$1.deserialize(DruidDefaultSerializersModule.java:59)
at io.druid.jackson.DruidDefaultSerializersModule$1.deserialize(DruidDefaultSerializersModule.java:54)
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:538)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:344)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1064)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:264)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeOther(BeanDeserializer.java:156)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:126)
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer._deserializeTypedForId(AsPropertyTypeDeserializer.java:113)
at com.fasterxml.jackson.databind.jsontype.impl.AsPropertyTypeDeserializer.deserializeTypedFromObject(AsPropertyTypeDeserializer.java:84)
at com.fasterxml.jackson.databind.deser.AbstractDeserializer.deserializeWithType(AbstractDeserializer.java:132)
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:536)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:344)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1064)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:264)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:124)
at com.fasterxml.jackson.databind.deser.SettableBeanProperty.deserialize(SettableBeanProperty.java:538)
at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:344)
at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1064)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:264)
at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:124)
at com.fasterxml.jackson.databind.ObjectMapper._convert(ObjectMapper.java:2769)
at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:2700)
at com.metamx.tranquility.druid.DruidBeams$.makeFireDepartment(DruidBeams.scala:433)
at com.metamx.tranquility.druid.DruidBeams$.fromConfigInternal(DruidBeams.scala:299)
at com.metamx.tranquility.druid.DruidBeams$.fromConfig(DruidBeams.scala:204)
at com.metamx.tranquility.server.http.ServerMain$$anonfun$2.apply(ServerMain.scala:118)
at com.metamx.tranquility.server.http.ServerMain$$anonfun$2.apply(ServerMain.scala:98)
at com.metamx.common.scala.collection.package$MapLikeOps$$anonfun$strictMapValues$1.apply(package.scala:143)
at com.metamx.common.scala.collection.package$MapLikeOps$$anonfun$strictMapValues$1.apply(package.scala:143)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.TraversableLike$$anonfun$map$1.apply(TraversableLike.scala:245)
at scala.collection.immutable.Map$Map1.foreach(Map.scala:116)
at scala.collection.TraversableLike$class.map(TraversableLike.scala:245)
at scala.collection.AbstractTraversable.map(Traversable.scala:104)
at com.metamx.common.scala.collection.package$MapLikeOps.strictMapValues(package.scala:143)
at com.metamx.tranquility.server.http.ServerMain$.createServlet(ServerMain.scala:98)
at com.metamx.tranquility.server.http.ServerMain$.main(ServerMain.scala:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.twitter.app.App$$anonfun$nonExitingMain$3.apply(App.scala:168)
at com.twitter.app.App$$anonfun$nonExitingMain$3.apply(App.scala:167)
at scala.Option.foreach(Option.scala:257)
at com.twitter.app.App$class.nonExitingMain(App.scala:167)
at com.metamx.tranquility.server.http.ServerMain$.nonExitingMain(ServerMain.scala:49)
at com.twitter.app.App$class.main(App.scala:133)
at com.metamx.tranquility.server.http.ServerMain$.main(ServerMain.scala:49)
at com.metamx.tranquility.distribution.DistributionMain$.main(DistributionMain.scala:34)
at com.metamx.tranquility.distribution.DistributionMain.main(DistributionMain.scala)

``

Hey bg,

Tranquility only supports the older, hardcoded granularities. I think “THIRTY_MINUTE” should do it. You might also want to consider using Druid’s builtin Kafka ingestion rather than Tranquility.

Hey Gian,

On a similar note,

I have recently seen multiple posts which encourages to use kafka indexing service instead of tranquility server. I would love to get rid of the window periods and smaller granularities.

But in the docs, it is mentioned that kafka-indexing-service is an experimental feature.

Could you please clarify a bit.

THANKS

Hey Sunil,

IMO the Kafka indexing service is already better than Tranquillity (especially in 0.12.3 and the future 0.13.0) and is on track to be marked ‘non experimental’ soon. At this point I would not hesitate to use it. And stay tuned for an official announcement in the future. (If you are interested in the discussion about that, join the Druid dev list: dev@druid.apache.org)

Thanks for the clarification Gian.