/*
 * Druid - a distributed column store.
 * Copyright (C) 2012, 2013  Metamarkets Group Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

package io.druid.client.cache;

import com.fasterxml.jackson.annotation.JsonProperty;

import javax.validation.constraints.NotNull;

public class MemcachedCacheConfig
{
  @JsonProperty
  private int expiration = 2592000; // What is this number?
  @JsonProperty
  private int timeout = 500;
  @JsonProperty
  @NotNull
  private String hosts;
  @JsonProperty
  private int maxObjectSize = 50 * 1024 * 1024;
  @JsonProperty
  private String memcachedPrefix = "druid";

  // maximum size in bytes of memcached client operation queue. 0 means unlimited
  @JsonProperty
  private long maxOperationQueueSize = 0;

  public int getExpiration()
  {
    return expiration;
  }

  public int getTimeout()
  {
    return timeout;
  }

  public String getHosts()
  {
    return hosts;
  }

  public int getMaxObjectSize()
  {
    return maxObjectSize;
  }

  public String getMemcachedPrefix()
  {
    return memcachedPrefix;
  }

  public long getMaxOperationQueueSize()
  {
    return maxOperationQueueSize;
  }
}

@@ -983,16 +983,179 @@
 onfig%0A%7B%0A
+  // default to 30 day expiration for cache entries%0A  // values greater than 30 days are interpreted by memcached as absolute POSIX timestamps instead of duration%0A
   @JsonP
@@ -1193,40 +1193,24 @@
 n = 
-2592000; // What is this number?
+30 * 24 * 3600;%0A
 %0A  @
@@ -1250,16 +1250,96 @@
 t = 500;
+%0A%0A  // comma delimited list of memcached servers, given as host:port combination
 %0A  @Json
@@ -1382,16 +1382,17 @@
  hosts;%0A
+%0A
   @JsonP
@@ -1447,16 +1447,17 @@
 * 1024;%0A
+%0A
   @JsonP

add comments