trafficserver-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jplev...@apache.org
Subject svn commit: r905441 [1/2] - in /incubator/trafficserver/traffic/branches/dev: iocore/cache/ iocore/cluster/ libinktomi++/ proxy/ proxy/http2/
Date Mon, 01 Feb 2010 23:06:02 GMT
Author: jplevyak
Date: Mon Feb  1 23:06:01 2010
New Revision: 905441

URL: http://svn.apache.org/viewvc?rev=905441&view=rev
Log:
TS-133: This is a framework and initial write/lookup/read regression test for the
cache.  Also removed some unused events and removed hard-coded constants from 
proxy/EventName.cc and fixed the assignment of MD5 hash keys.

Added:
    incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheTest.cc
Modified:
    incubator/trafficserver/traffic/branches/dev/iocore/cache/Cache.cc
    incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheRead.cc
    incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheWrite.cc
    incubator/trafficserver/traffic/branches/dev/iocore/cache/I_Cache.h
    incubator/trafficserver/traffic/branches/dev/iocore/cache/I_CacheDefs.h
    incubator/trafficserver/traffic/branches/dev/iocore/cache/Makefile.am
    incubator/trafficserver/traffic/branches/dev/iocore/cache/P_CacheInternal.h
    incubator/trafficserver/traffic/branches/dev/iocore/cache/P_CacheTest.h
    incubator/trafficserver/traffic/branches/dev/iocore/cache/RamCache.cc
    incubator/trafficserver/traffic/branches/dev/iocore/cluster/ClusterCache.cc
    incubator/trafficserver/traffic/branches/dev/iocore/cluster/P_ClusterCacheInternal.h
    incubator/trafficserver/traffic/branches/dev/libinktomi++/INK_MD5.h
    incubator/trafficserver/traffic/branches/dev/proxy/EventName.cc
    incubator/trafficserver/traffic/branches/dev/proxy/ICP.cc
    incubator/trafficserver/traffic/branches/dev/proxy/InkAPI.cc
    incubator/trafficserver/traffic/branches/dev/proxy/Makefile.am
    incubator/trafficserver/traffic/branches/dev/proxy/RegressionSM.cc
    incubator/trafficserver/traffic/branches/dev/proxy/RegressionSM.h
    incubator/trafficserver/traffic/branches/dev/proxy/http2/HttpDebugNames.cc

Modified: incubator/trafficserver/traffic/branches/dev/iocore/cache/Cache.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cache/Cache.cc?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cache/Cache.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cache/Cache.cc Mon Feb  1 23:06:01 2010
@@ -3047,3 +3047,8 @@
   }
   return caches[frag_type]->remove(cont, url, frag_type);
 }
+
+void force_loading_of_CacheTest() {
+  cache_regression_test = 1; // force loading of .o
+}
+

Modified: incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheRead.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheRead.cc?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheRead.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheRead.cc Mon Feb  1 23:06:01 2010
@@ -256,13 +256,13 @@
     }
     vector.clear(false);
     if (!write_vc) {
-      Debug("cache_read_agg", "%x: key: %X %X writer alternate different: %d", this, first_key.word(1), alternate_index);
+      DDebug("cache_read_agg", "%x: key: %X %X writer alternate different: %d", this, first_key.word(1), alternate_index);
       od = NULL;
       SET_HANDLER(&CacheVC::openReadStartHead);
       return openReadStartHead(EVENT_IMMEDIATE, 0);
     }
 
-    Debug("cache_read_agg",
+    DDebug("cache_read_agg",
           "%x: key: %X eKey: %d # alts: %d, ndx: %d, # writers: %d writer: %x",
           this, first_key.word(1), write_vc->earliest_key.word(1),
           vector.count(), alternate_index, od->num_writers, write_vc);
@@ -288,7 +288,7 @@
   }
   cancel_trigger();
   int err = ECACHE_DOC_BUSY;
-  Debug("cache_read_agg", "%x: key: %X In openReadFromWriter", this, first_key.word(1));
+  DDebug("cache_read_agg", "%x: key: %X In openReadFromWriter", this, first_key.word(1));
 #ifndef READ_WHILE_WRITER
   return openReadFromWriterFailure(CACHE_EVENT_OPEN_READ_FAILED, (Event *) - err);
 #else
@@ -310,7 +310,7 @@
       return ret;
   } else {
     if (writer_done()) {
-      Debug("cache_read_agg",
+      DDebug("cache_read_agg",
             "%x: key: %X writer %x has left, continuing as normal read", this, first_key.word(1), write_vc);
       od = NULL;
       write_vc = NULL;
@@ -332,7 +332,7 @@
   if (!write_vc->closed && !write_vc->fragment) {
     if (!cache_config_read_while_writer || frag_type != CACHE_FRAG_TYPE_HTTP)
       return openReadFromWriterFailure(CACHE_EVENT_OPEN_READ_FAILED, (Event *) - err);
-    Debug("cache_read_agg",
+    DDebug("cache_read_agg",
           "%x: key: %X writer: closed:%d, fragment:%d, retry: %d",
           this, first_key.word(1), write_vc->closed, write_vc->fragment, writer_lock_retry);
     VC_SCHED_WRITER_RETRY();
@@ -340,7 +340,7 @@
 
   CACHE_TRY_LOCK(writer_lock, write_vc->mutex, mutex->thread_holding);
   if (!writer_lock) {
-    Debug("cache_read_agg", "%x: key: %X lock miss", this, first_key.word(1));
+    DDebug("cache_read_agg", "%x: key: %X lock miss", this, first_key.word(1));
     VC_SCHED_LOCK_RETRY();
   }
 
@@ -348,7 +348,7 @@
     return openReadFromWriterFailure(CACHE_EVENT_OPEN_READ_FAILED, (Event *) - err);
 #ifdef HTTP_CACHE
   if (frag_type == CACHE_FRAG_TYPE_HTTP) {
-    Debug("cache_read_agg",
+    DDebug("cache_read_agg",
           "%x: key: %X http passed stage 1, closed: %d, frag: %d",
           this, first_key.word(1), write_vc->closed, write_vc->fragment);
     if (!write_vc->alternate.valid())
@@ -366,7 +366,7 @@
     } else {
       key = write_vc->update_key;
       ink_assert(write_vc->closed);
-      Debug("cache_read_agg", "%x: key: %X writer header update", this, first_key.word(1));
+      DDebug("cache_read_agg", "%x: key: %X writer header update", this, first_key.word(1));
       // Update case (b) : grab doc_len from the writer's alternate
       doc_len = alternate.object_size_get();
       if (write_vc->update_key == cod->single_doc_key &&
@@ -398,7 +398,7 @@
     }
   } else {
 #endif //HTTP_CACHE
-    Debug("cache_read_agg", "%x: key: %X non-http passed stage 1", this, first_key.word(1));
+    DDebug("cache_read_agg", "%x: key: %X non-http passed stage 1", this, first_key.word(1));
     key = write_vc->earliest_key;
 #ifdef HTTP_CACHE
   }
@@ -406,7 +406,7 @@
   if (write_vc->fragment) {
     doc_len = write_vc->vio.nbytes;
     last_collision = NULL;
-    Debug("cache_read_agg",
+    DDebug("cache_read_agg",
           "%x: key: %X closed: %d, fragment: %d, len: %d starting first fragment",
           this, first_key.word(1), write_vc->closed, write_vc->fragment, (int)doc_len);
     MUTEX_RELEASE(writer_lock);
@@ -425,7 +425,7 @@
   doc_len = write_vc->total_len;
   dir_clean(&first_dir);
   dir_clean(&earliest_dir);
-  Debug("cache_read_agg", "%x key: %X %X: single fragment read", first_key.word(1), key.word(0));
+  DDebug("cache_read_agg", "%x key: %X %X: single fragment read", first_key.word(1), key.word(0));
   MUTEX_RELEASE(writer_lock);
   SET_HANDLER(&CacheVC::openReadFromWriterMain);
   CACHE_INCREMENT_DYN_STAT(cache_read_busy_success_stat);
@@ -450,7 +450,7 @@
   if (ntodo <= 0)
     return EVENT_CONT;
   if (length < ((ink64)doc_len) - vio.ndone) {
-    Debug("cache_read_agg", "truncation %X", earliest_key.word(0));
+    DDebug("cache_read_agg", "truncation %X", earliest_key.word(0));
     if (is_action_tag_set("cache")) {
       ink_release_assert(false);
     }
@@ -561,17 +561,17 @@
         last_collision = NULL;
         while (dir_probe(&earliest_key, part, &dir, &last_collision)) {
           if (dir_offset(&dir) == dir_offset(&earliest_dir)) {
-            Debug("cache_read_agg", "%x: key: %X ReadRead complete: %d", 
+            DDebug("cache_read_agg", "%x: key: %X ReadRead complete: %d", 
                   this, first_key.word(1), (int)vio.ndone);
             doc_len = vio.ndone;
             goto Ldone;
           }
         }
-        Debug("cache_read_agg", "%x: key: %X ReadRead writer aborted: %d", 
+        DDebug("cache_read_agg", "%x: key: %X ReadRead writer aborted: %d", 
               this, first_key.word(1), (int)vio.ndone);
         goto Lerror;
       }
-      Debug("cache_read_agg", "%x: key: %X ReadRead retrying: %d", this, first_key.word(1), (int)vio.ndone);
+      DDebug("cache_read_agg", "%x: key: %X ReadRead retrying: %d", this, first_key.word(1), (int)vio.ndone);
       VC_SCHED_WRITER_RETRY(); // wait for writer
     }
     // fall through for truncated documents
@@ -686,17 +686,17 @@
         last_collision = NULL;
         while (dir_probe(&earliest_key, part, &dir, &last_collision)) {
           if (dir_offset(&dir) == dir_offset(&earliest_dir)) {
-            Debug("cache_read_agg", "%x: key: %X ReadMain complete: %d", 
+            DDebug("cache_read_agg", "%x: key: %X ReadMain complete: %d", 
                   this, first_key.word(1), (int)vio.ndone);
             doc_len = vio.ndone;
             goto Leos;
           }
         }
-        Debug("cache_read_agg", "%x: key: %X ReadMain writer aborted: %d", 
+        DDebug("cache_read_agg", "%x: key: %X ReadMain writer aborted: %d", 
               this, first_key.word(1), (int)vio.ndone);
         goto Lerror;
       }
-      Debug("cache_read_agg", "%x: key: %X ReadMain retrying: %d", this, first_key.word(1), (int)vio.ndone);
+      DDebug("cache_read_agg", "%x: key: %X ReadMain retrying: %d", this, first_key.word(1), (int)vio.ndone);
       SET_HANDLER(&CacheVC::openReadMain);
       VC_SCHED_WRITER_RETRY();
     }
@@ -778,7 +778,7 @@
 #ifdef HIT_EVACUATE
     if (part->within_hit_evacuate_window(&earliest_dir) &&
         (!cache_config_hit_evacuate_size_limit || doc_len <= cache_config_hit_evacuate_size_limit)) {
-      Debug("cache_hit_evac", "dir: %d, write: %d, phase: %d",
+      DDebug("cache_hit_evac", "dir: %d, write: %d, phase: %d",
             dir_offset(&earliest_dir), offset_to_part_offset(part, part->header->write_pos), part->header->phase);
       f.hit_evacuate = 1;
     }
@@ -1048,7 +1048,7 @@
 #ifdef HIT_EVACUATE
     if (part->within_hit_evacuate_window(&dir) &&
         (!cache_config_hit_evacuate_size_limit || doc_len <= cache_config_hit_evacuate_size_limit)) {
-      Debug("cache_hit_evac", "dir: %d, write: %d, phase: %d",
+      DDebug("cache_hit_evac", "dir: %d, write: %d, phase: %d",
             dir_offset(&dir), offset_to_part_offset(part, part->header->write_pos), part->header->phase);
       f.hit_evacuate = 1;
     }

Added: incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheTest.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheTest.cc?rev=905441&view=auto
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheTest.cc (added)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheTest.cc Mon Feb  1 23:06:01 2010
@@ -0,0 +1,311 @@
+/** @file
+
+  A brief file description
+
+  @section license License
+
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+ */
+
+#include "P_Cache.h"
+#include "P_CacheTest.h"
+
+
+CacheTestSM::CacheTestSM(RegressionTest *t) :
+  RegressionSM(t),
+  timeout(0),
+  cache_action(0),
+  start_time(0),
+  cache_vc(0),
+  cvio(0),
+  buffer(0),
+  buffer_reader(0),
+  total_size(-1),
+  repeat_count(0),
+  expect_event(EVENT_NONE),
+  expect_initial_event(EVENT_NONE),
+  initial_event(EVENT_NONE),
+  flags(0)
+{
+  SET_HANDLER(&CacheTestSM::event_handler);
+}
+
+CacheTestSM::~CacheTestSM() {
+  ink_assert(!cache_action);
+  ink_assert(!cache_vc);
+  if (buffer_reader)
+    buffer->dealloc_reader(buffer_reader);
+  if (buffer)
+    free_MIOBuffer(buffer);
+}
+
+int CacheTestSM::event_handler(int event, void *data) {
+
+  switch (event) {
+
+    case EVENT_INTERVAL:
+    case EVENT_IMMEDIATE:
+      cancel_timeout();
+      if (cache_action) {
+        cache_action->cancel();
+        cache_action = 0;
+      }
+      if (cache_vc) {
+        cache_vc->do_io_close();
+        cache_vc = 0;
+      }
+      cvio = 0;
+      make_request();
+      return EVENT_DONE;
+
+    case CACHE_EVENT_LOOKUP_FAILED:
+    case CACHE_EVENT_LOOKUP:
+      goto Lcancel_next;
+
+    case CACHE_EVENT_OPEN_READ:
+      initial_event = event;
+      cancel_timeout();
+      cache_action = 0;
+      cache_vc = (CacheVConnection*)data;
+      buffer = new_empty_MIOBuffer();
+      buffer_reader = buffer->alloc_reader();
+      cvio = cache_vc->do_io_read(this, total_size, buffer);
+      return EVENT_DONE;
+   
+    case CACHE_EVENT_OPEN_READ_FAILED:
+      goto Lcancel_next;
+
+    case VC_EVENT_READ_READY:
+      if (!check_buffer())
+        goto Lclose_error_next;
+      buffer_reader->consume(buffer_reader->read_avail());
+      ((VIO*)data)->reenable();
+      return EVENT_CONT;
+
+    case VC_EVENT_READ_COMPLETE:
+      if (!check_buffer())
+        goto Lclose_error_next;
+      goto Lclose_next;
+
+    case VC_EVENT_ERROR:
+    case VC_EVENT_EOS:
+      goto Lclose_error_next;
+
+    case CACHE_EVENT_OPEN_WRITE:
+      initial_event = event;
+      cancel_timeout();
+      cache_action = 0;
+      cache_vc = (CacheVConnection*)data;
+      buffer = new_empty_MIOBuffer();
+      buffer_reader = buffer->alloc_reader();
+      cvio = cache_vc->do_io_write(this, total_size, buffer_reader);
+      return EVENT_DONE;
+      
+    case CACHE_EVENT_OPEN_WRITE_FAILED:
+      goto Lcancel_next;
+
+    case VC_EVENT_WRITE_READY:
+      fill_buffer();
+      cvio->reenable();
+      return EVENT_CONT;
+
+    case VC_EVENT_WRITE_COMPLETE:
+      if (total_size != cvio->ndone)
+        goto Lclose_error_next;
+      goto Lclose_next;
+
+    case CACHE_EVENT_REMOVE:
+    case CACHE_EVENT_REMOVE_FAILED:
+      goto Lcancel_next;
+
+    case CACHE_EVENT_SCAN:
+      initial_event = event;
+      cache_vc = (CacheVConnection*)data;
+      return EVENT_CONT;
+
+    case CACHE_EVENT_SCAN_OBJECT:
+      return CACHE_SCAN_RESULT_CONTINUE;
+
+    case CACHE_EVENT_SCAN_OPERATION_FAILED:
+      return CACHE_SCAN_RESULT_CONTINUE;
+
+    case CACHE_EVENT_SCAN_OPERATION_BLOCKED:
+      return CACHE_SCAN_RESULT_CONTINUE;
+
+    case CACHE_EVENT_SCAN_DONE:
+      return EVENT_CONT;
+
+    case CACHE_EVENT_SCAN_FAILED:
+      return EVENT_CONT;
+
+    case AIO_EVENT_DONE:
+      goto Lnext;
+
+    default: 
+      ink_assert(!"case");
+      break;
+  }
+  return EVENT_DONE;
+
+Lcancel_next:
+  cancel_timeout();
+  cache_action = 0;
+  goto Lnext;
+Lclose_error_next:
+  cache_vc->do_io_close(1);
+  goto Lclose_next_internal;
+Lclose_next:
+  cache_vc->do_io_close();
+Lclose_next_internal:
+  cache_vc = 0;
+  if (buffer_reader) {
+    buffer->dealloc_reader(buffer_reader);
+    buffer_reader = 0;
+  }
+  if (buffer) {
+    free_MIOBuffer(buffer);
+    buffer = 0;
+  }
+Lnext:
+  if (check_result(event) && repeat_count) {
+    repeat_count--;
+    timeout = eventProcessor.schedule_imm(this);
+    return EVENT_DONE;
+  } else
+    return complete(event);
+}
+
+void CacheTestSM::fill_buffer() {
+  ink64 avail = buffer->write_avail();
+  CacheKey k = key;
+  ink64 sk = (ink64)sizeof(key);
+  while (avail > 0) {
+    ink64 l = avail;
+    if (l > sk)
+      l = sk;
+    ink64 pos = cvio->ndone +  buffer_reader->read_avail();
+    int o = pos % sk;
+    if (l > sk - o)
+      l = sk - o;
+    k.b[0] = pos / sk;
+    char *x = ((char*)&k) + o;
+    buffer->write(x, l);
+    buffer->fill(l);
+    avail -= l;
+  }
+}
+
+int CacheTestSM::check_buffer() { 
+  ink64 avail = buffer_reader->read_avail();
+  CacheKey k = key;
+  char b[sizeof(key)];
+  ink64 sk = (ink64)sizeof(key);
+  ink64 pos = cvio->ndone -  buffer_reader->read_avail();
+  while (avail > 0) {
+    ink64 l = avail;
+    if (l > sk)
+      l = sk;
+    int o = pos % sk;
+    if (l > sk - o)
+      l = sk - o;
+    k.b[0] = pos / sk;
+    char *x = ((char*)&k) + o;
+    buffer_reader->read(&b[0], l);
+    if (::memcmp(b, x, l))
+      return 0;
+    buffer_reader->consume(l);
+    pos += l;
+    avail -= l;
+  }
+  return 1; 
+}
+
+int CacheTestSM::check_result(int event) {
+  return 
+    initial_event == expect_initial_event &&
+    event == expect_event;
+}
+
+int CacheTestSM::complete(int event) {
+  if (!check_result(event))
+    done(REGRESSION_TEST_FAILED);
+  else
+    done(REGRESSION_TEST_PASSED);
+  delete this;
+  return EVENT_DONE;
+}
+
+CacheTestSM::CacheTestSM(const CacheTestSM &ao) : RegressionSM(ao) {
+  timeout = ao.timeout;
+  cache_action = ao.cache_action; 
+  start_time = ao.start_time; 
+  cache_vc = ao.cache_vc;
+  cvio = ao.cvio;
+  buffer = ao.buffer;
+  buffer_reader = ao.buffer_reader;
+#ifdef HTTP_CACHE
+  params = ao.params;
+  info = ao.info;
+#endif
+  total_size = ao.total_size;
+  memcpy(urlstr, ao.urlstr, 1024);
+  key = ao.key;
+  repeat_count = ao.repeat_count;
+  expect_event = ao.expect_event;
+  expect_initial_event = ao.expect_initial_event;
+  initial_event = ao.initial_event;
+  flags = ao.flags;
+  SET_HANDLER(&CacheTestSM::event_handler);
+}
+
+EXCLUSIVE_REGRESSION_TEST(cache)(RegressionTest *t, int atype, int *pstatus) {
+  if (cacheProcessor.IsCacheEnabled() != CACHE_INITIALIZED) {
+    rprintf(t, "cache not initialized");
+    *pstatus = REGRESSION_TEST_FAILED;
+    return;
+  }
+
+  EThread *thread = this_ethread();
+
+  CACHE_SM(t, write_test, { cacheProcessor.open_write(this, &key); } );
+  write_test.expect_initial_event = CACHE_EVENT_OPEN_WRITE;
+  write_test.expect_event = VC_EVENT_WRITE_COMPLETE;
+  write_test.total_size = 100;
+  rand_CacheKey(&write_test.key, thread->mutex);
+
+  CACHE_SM(t, lookup_test, { cacheProcessor.lookup(this, &key); } );
+  lookup_test.expect_event = CACHE_EVENT_LOOKUP;
+  lookup_test.key = write_test.key;
+  
+  CACHE_SM(t, read_test, { cacheProcessor.open_read(this, &key); } );
+  read_test.expect_initial_event = CACHE_EVENT_OPEN_READ;
+  read_test.expect_event = VC_EVENT_READ_COMPLETE;
+  read_test.total_size = 100;
+  read_test.key = write_test.key;
+  
+  r_sequential(
+    t,
+    write_test.clone(),
+    lookup_test.clone(),
+    read_test.clone(),
+    NULL
+    )->run(pstatus);
+  return;
+}
+
+int cache_regression_test = 0;

Modified: incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheWrite.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheWrite.cc?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheWrite.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cache/CacheWrite.cc Mon Feb  1 23:06:01 2010
@@ -276,7 +276,7 @@
   if (!b) {
     b = new_EvacuationBlock(mutex->thread_holding);
     b->dir = *evac_dir;
-    Debug("cache_evac", "force: %d, %d", (int) dir_offset(evac_dir), (int) dir_phase(evac_dir));
+    DDebug("cache_evac", "force: %d, %d", (int) dir_offset(evac_dir), (int) dir_phase(evac_dir));
     evacuate[dir_evac_bucket(evac_dir)].push(b);
   }
   b->f.pinned = pinned;
@@ -297,7 +297,7 @@
     int pe = offset_to_part_offset(this, header->write_pos + 2 * EVACUATION_SIZE + (len / PIN_SCAN_EVERY));
     int part_end_offset = offset_to_part_offset(this, len + skip);
     int before_end_of_part = pe < part_end_offset;
-    Debug("cache_evac", "scan %d %d", ps, pe);
+    DDebug("cache_evac", "scan %d %d", ps, pe);
     for (int i = 0; i < part_direntries(this); i++) {
       // is it a valid pinned object?
       if (!dir_is_empty(&dir[i]) && dir_pinned(&dir[i]) && dir_head(&dir[i])) {
@@ -311,7 +311,7 @@
             continue;
         }
         force_evacuate_head(&dir[i], 1);
-        //      Debug("cache_evac", "scan pinned at offset %d %d %d %d %d %d",
+        //      DDebug("cache_evac", "scan pinned at offset %d %d %d %d %d %d",
         //            (int)dir_offset(&b->dir), ps, o , pe, i, (int)b->f.done);
       }
     }
@@ -343,7 +343,7 @@
     header->last_write_pos = header->write_pos;
     header->write_pos += io.aiocb.aio_nbytes;
     ink_assert(header->write_pos >= start);
-    Debug("cache_agg", "Dir %s, Write: %llu, last Write: %llu\n", 
+    DDebug("cache_agg", "Dir %s, Write: %llu, last Write: %llu\n", 
           hash_id, header->write_pos, header->last_write_pos);
     ink_assert(header->write_pos == header->agg_pos);
     if (header->write_pos + EVACUATION_SIZE > scan_pos)
@@ -439,7 +439,7 @@
     if (!(next_key == earliest_key))
       goto Ldone;
     doc_len = doc->total_len;
-    Debug("cache_evac",
+    DDebug("cache_evac",
           "evacuateReadHead non-http earliest %X first: %X len: %d", first_key.word(0), earliest_key.word(0), doc_len);
   }
   if (doc_len == total_len) {
@@ -469,7 +469,7 @@
 
   ink_debug_assert(part->mutex->thread_holding == this_ethread());
   Doc *doc = (Doc *) buf->data();
-  Debug("cache_evac", "evacuateDocDone %X o %d p %d new_o %d new_p %d",
+  DDebug("cache_evac", "evacuateDocDone %X o %d p %d new_o %d new_p %d",
         (int) key.word(0), (int) dir_offset(&overwrite_dir),
         (int) dir_phase(&overwrite_dir), (int) dir_offset(&dir), (int) dir_phase(&dir));
   int i = dir_evac_bucket(&overwrite_dir);
@@ -493,7 +493,7 @@
         if (!evac)
           break;
         if (evac->earliest_key.fold()) {
-          Debug("cache_evac", "evacdocdone: evacuating key %X earliest %X",
+          DDebug("cache_evac", "evacdocdone: evacuating key %X earliest %X",
                 evac->key.word(0), evac->earliest_key.word(0));
           EvacuationBlock *eblock = 0;
           Dir dir_tmp;
@@ -515,17 +515,17 @@
       // Cache::open_write). Once we know its the vector, we can
       // safely overwrite the first_key in the directory.
       if (dir_head(&overwrite_dir) && b->f.evacuate_head) {
-        Debug("cache_evac",
+        DDebug("cache_evac",
               "evacuateDocDone evacuate_head %X %X hlen %d offset %d",
               (int) key.word(0), (int) doc->key.word(0), doc->hlen, (int) dir_offset(&overwrite_dir));
 
         if (dir_compare_tag(&overwrite_dir, &doc->first_key)) {
           OpenDirEntry *cod;
-          Debug("cache_evac", "evacuating vector: %X %d",
+          DDebug("cache_evac", "evacuating vector: %X %d",
                 (int) doc->first_key.word(0), (int) dir_offset(&overwrite_dir));
           if ((cod = part->open_read(&doc->first_key))) {
             // writer  exists
-            Debug("cache_evac", "overwriting the open directory %X %d %d",
+            DDebug("cache_evac", "overwriting the open directory %X %d %d",
                   (int) doc->first_key.word(0), (int) dir_offset(&cod->first_dir), (int) dir_offset(&dir));
             ink_assert(dir_pinned(&dir));
             cod->first_dir = dir;
@@ -535,7 +535,7 @@
             part->ram_cache.fixup(&doc->first_key, 0, dir_offset(&overwrite_dir), 0, dir_offset(&dir));
           }
         } else {
-          Debug("cache_evac", "evacuating earliest: %X %d", (int) doc->key.word(0), (int) dir_offset(&overwrite_dir));
+          DDebug("cache_evac", "evacuating earliest: %X %d", (int) doc->key.word(0), (int) dir_offset(&overwrite_dir));
           ink_debug_assert(dir_compare_tag(&overwrite_dir, &doc->key));
           ink_assert(b->earliest_evacuator == this);
           total_len += doc->data_len();
@@ -587,7 +587,7 @@
     }
     if (force)
       b->readers = 0;
-    Debug("cache_evac",
+    DDebug("cache_evac",
           "next fragment %X Earliest: %X offset %d phase %d force %d",
           (int) key->word(0), (int) earliest_key->word(0), (int) dir_offset(&dir), (int) dir_phase(&dir), force);
   }
@@ -634,7 +634,7 @@
     ink_assert(doc->magic == DOC_MAGIC);
     goto Ldone;
   }
-  Debug("cache_evac", "evacuateDocReadDone %X offset %d",
+  DDebug("cache_evac", "evacuateDocReadDone %X offset %d",
         (int) doc->key.word(0), (int) dir_offset(&doc_evacuator->overwrite_dir));
 
   b = evacuate[dir_evac_bucket(&doc_evacuator->overwrite_dir)].head;
@@ -655,7 +655,7 @@
     if (dir_compare_tag(&b->dir, &doc->first_key)) {
       doc_evacuator->key = doc->first_key;
       b->evac_frags.key = doc->first_key;
-      Debug("cache_evac", "evacuating vector %X offset %d",
+      DDebug("cache_evac", "evacuating vector %X offset %d",
             (int) doc->first_key.word(0), (int) dir_offset(&doc_evacuator->overwrite_dir));
       b->f.unused = 57;
     } else {
@@ -668,7 +668,7 @@
       b->evac_frags.key = doc->key;
       b->evac_frags.earliest_key = doc->key;
       b->earliest_evacuator = doc_evacuator;
-      Debug("cache_evac", "evacuating earliest %X %X evac: %X offset: %d",
+      DDebug("cache_evac", "evacuating earliest %X %X evac: %X offset: %d",
             (int) b->evac_frags.key.word(0), (int) doc->key.word(0),
             doc_evacuator, (int) dir_offset(&doc_evacuator->overwrite_dir));
       b->f.unused = 67;
@@ -683,7 +683,7 @@
     }
     doc_evacuator->key = ek->key;
     doc_evacuator->earliest_key = ek->earliest_key;
-    Debug("cache_evac", "evacuateDocReadDone key: %X earliest: %X",
+    DDebug("cache_evac", "evacuateDocReadDone key: %X earliest: %X",
           (int) ek->key.word(0), (int) ek->earliest_key.word(0));
     b->f.unused = 87;
   }
@@ -736,7 +736,7 @@
       io.aiocb.aio_buf = doc_evacuator->buf->data();
       io.action = this;
       io.thread = AIO_CALLBACK_THREAD_ANY;
-      Debug("cache_evac", "evac_range evacuating %X %d", (int)dir_tag(&first->dir), (int)dir_offset(&first->dir));
+      DDebug("cache_evac", "evac_range evacuating %X %d", (int)dir_tag(&first->dir), (int)dir_offset(&first->dir));
       SET_HANDLER(&Part::evacuateDocReadDone);
       ink_assert(ink_aio_read(&io) >= 0);
       return -1;
@@ -903,7 +903,7 @@
           header->write_pos > part_offset(this, &b->dir)) ||
          (header->phase == dir_phase(&b->dir) && header->write_pos <= part_offset(this, &b->dir)))) {
       EvacuationBlock *x = b;
-      Debug("cache_evac", "evacuate cleanup free %X offset %d",
+      DDebug("cache_evac", "evacuate cleanup free %X offset %d",
             (int) b->evac_frags.key.word(0), (int) dir_offset(&b->dir));
       b = b->link.next;
       evacuate[i].remove(x);
@@ -990,7 +990,7 @@
     if (agg_buf_pos + writelen > AGG_SIZE || 
         header->write_pos + agg_buf_pos + writelen > (skip + len))
       break;
-    Debug("agg_read", "copying: %d, %llu, key: %d", 
+    DDebug("agg_read", "copying: %d, %llu, key: %d", 
           agg_buf_pos, header->write_pos + agg_buf_pos, c->first_key.word(0));
     int wrotelen = agg_copy(agg_buffer + agg_buf_pos, c);
     ink_assert(writelen == wrotelen);
@@ -1105,7 +1105,7 @@
   // updates we dont decrement the variable corresponding the old
   // size of the document
   if ((closed == 1) && (total_len > 0)) {
-    Debug("cache_stats", "Fragment = %d", fragment);
+    DDebug("cache_stats", "Fragment = %d", fragment);
     switch (fragment) {
       case 0: CACHE_INCREMENT_DYN_STAT(cache_single_fragment_document_count_stat); break;
       case 1: CACHE_INCREMENT_DYN_STAT(cache_two_fragment_document_count_stat); break;
@@ -1296,7 +1296,7 @@
     fragment++;
     write_pos += write_len;
     dir_insert(&key, part, &dir);
-    Debug("cache_insert", "WriteDone: %X, %X, %d", key.word(0), first_key.word(0), write_len);
+    DDebug("cache_insert", "WriteDone: %X, %X, %d", key.word(0), first_key.word(0), write_len);
     blocks = iobufferblock_skip(blocks, &offset, &length, write_len);
     next_CacheKey(&key, &key);
   }
@@ -1447,7 +1447,7 @@
        to NULL.
      */
     if (!dir_valid(part, &dir)) {
-      Debug("cache_write",
+      DDebug("cache_write",
             "OpenReadStartDone: Dir not valid: Write Head: %d, Dir: %d",
             offset_to_part_offset(part, part->header->write_pos), dir_offset(&dir));
       last_collision = NULL;
@@ -1702,7 +1702,7 @@
      */
     c->f.update = 1;
     c->base_stat = cache_update_active_stat;
-    Debug("cache_update", "Update called");
+    DDebug("cache_update", "Update called");
     info->object_key_get(&c->update_key);
     ink_debug_assert(!(c->update_key == zero_key));
     c->update_len = info->object_size_get();

Modified: incubator/trafficserver/traffic/branches/dev/iocore/cache/I_Cache.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cache/I_Cache.h?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cache/I_Cache.h (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cache/I_Cache.h Mon Feb  1 23:06:01 2010
@@ -57,51 +57,57 @@
   int dir_check(bool fix);
   int db_check(bool fix);
 
-  inkcoreapi Action *lookup(Continuation * cont, CacheKey * key,
+  inkcoreapi Action *lookup(Continuation *cont, CacheKey *key,
                             bool local_only = false,
-                            CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP, char *hostname = 0, int host_len = 0);
-  inkcoreapi Action *open_read(Continuation * cont, CacheKey * key,
-                               CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP, char *hostname = 0, int host_len = 0);
-  Action *open_read_buffer(Continuation * cont, MIOBuffer * buf, CacheKey * key,
-                           CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP, char *hostname = 0, int host_len = 0);
-
-  inkcoreapi Action *open_write(Continuation * cont, int expected_size,
-                                CacheKey * key, CacheFragType frag_type,
+                            CacheFragType frag_type = CACHE_FRAG_TYPE_NONE, char *hostname = 0, int host_len = 0);
+  inkcoreapi Action *open_read(Continuation *cont, CacheKey *key,
+                               CacheFragType frag_type = CACHE_FRAG_TYPE_NONE, char *hostname = 0, int host_len = 0);
+  Action *open_read_buffer(Continuation *cont, MIOBuffer *buf, CacheKey *key,
+                           CacheFragType frag_type = CACHE_FRAG_TYPE_NONE, char *hostname = 0, int host_len = 0);
+
+  inkcoreapi Action *open_write(Continuation *cont, 
+                                CacheKey *key, 
+                                CacheFragType frag_type = CACHE_FRAG_TYPE_NONE,
+                                int expected_size = CACHE_EXPECTED_SIZE,
                                 bool overwrite = false,
-                                time_t pin_in_cache = (time_t) 0, char *hostname = 0, int host_len = 0);
-  Action *open_write_buffer(Continuation * cont, MIOBuffer * buf,
-                            CacheKey * key, bool overwrite = false,
-                            CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP, char *hostname = 0, int host_len = 0);
-  inkcoreapi Action *remove(Continuation * cont, CacheKey * key,
+                                time_t pin_in_cache = (time_t) 0,
+                                char *hostname = 0, int host_len = 0);
+  Action *open_write_buffer(Continuation *cont, MIOBuffer *buf,
+                            CacheKey *key, 
+                            CacheFragType frag_type = CACHE_FRAG_TYPE_NONE, 
+                            bool overwrite = false,
+                            time_t pin_in_cache = (time_t) 0,
+                            char *hostname = 0, int host_len = 0);
+  inkcoreapi Action *remove(Continuation *cont, CacheKey *key,
                             bool rm_user_agents = true, bool rm_link = false,
-                            CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP, char *hostname = 0, int host_len = 0);
-  Action *scan(Continuation * cont, char *hostname = 0, int host_len = 0, int KB_per_second = 2500);
+                            CacheFragType frag_type = CACHE_FRAG_TYPE_NONE, char *hostname = 0, int host_len = 0);
+  Action *scan(Continuation *cont, char *hostname = 0, int host_len = 0, int KB_per_second = 2500);
 #ifdef HTTP_CACHE
-  Action *lookup(Continuation * cont, URL * url, bool local_only = false,
+  Action *lookup(Continuation *cont, URL *url, bool local_only = false,
                  CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
-  inkcoreapi Action *open_read(Continuation * cont, URL * url,
-                               CacheHTTPHdr * request,
-                               CacheLookupHttpConfig * params,
+  inkcoreapi Action *open_read(Continuation *cont, URL *url,
+                               CacheHTTPHdr *request,
+                               CacheLookupHttpConfig *params,
                                time_t pin_in_cache = (time_t) 0, CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
-  Action *open_read_buffer(Continuation * cont, MIOBuffer * buf, URL * url,
-                           CacheHTTPHdr * request,
-                           CacheLookupHttpConfig * params, CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
-  Action *open_write(Continuation * cont, int expected_size, URL * url,
-                     CacheHTTPHdr * request, CacheHTTPInfo * old_info,
+  Action *open_read_buffer(Continuation *cont, MIOBuffer *buf, URL *url,
+                           CacheHTTPHdr *request,
+                           CacheLookupHttpConfig *params, CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
+  Action *open_write(Continuation *cont, int expected_size, URL *url,
+                     CacheHTTPHdr *request, CacheHTTPInfo *old_info,
                      time_t pin_in_cache = (time_t) 0, CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
-  Action *open_write_buffer(Continuation * cont, MIOBuffer * buf, URL * url,
-                            CacheHTTPHdr * request, CacheHTTPHdr * response,
+  Action *open_write_buffer(Continuation *cont, MIOBuffer *buf, URL *url,
+                            CacheHTTPHdr *request, CacheHTTPHdr *response,
                             CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
-  Action *remove(Continuation * cont, URL * url, CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
+  Action *remove(Continuation *cont, URL *url, CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP);
 
   Action *open_read_internal(int, Continuation *, MIOBuffer *, CacheURL *,
                              CacheHTTPHdr *, CacheLookupHttpConfig *,
                              CacheKey *, time_t, CacheFragType type, char *hostname, int host_len);
 #endif
-  Action *link(Continuation * cont, CacheKey * from, CacheKey * to,
+  Action *link(Continuation *cont, CacheKey *from, CacheKey *to,
                CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP, char *hostname = 0, int host_len = 0);
 
-  Action *deref(Continuation * cont, CacheKey * key,
+  Action *deref(Continuation *cont, CacheKey *key,
                 CacheFragType frag_type = CACHE_FRAG_TYPE_HTTP, char *hostname = 0, int host_len = 0);
   static int IsCacheEnabled();
 
@@ -124,12 +130,12 @@
 
 struct CacheVConnection:public VConnection
 {
-  VIO *do_io_read(Continuation * c, ink64 nbytes, MIOBuffer * buf) = 0;
+  VIO *do_io_read(Continuation *c, ink64 nbytes, MIOBuffer *buf) = 0;
   virtual VIO *do_io_pread(Continuation *c, ink64 nbytes, MIOBuffer *buf, ink64 offset) = 0;
-  VIO *do_io_write(Continuation * c, ink64 nbytes, IOBufferReader * buf, bool owner = false) = 0;
+  VIO *do_io_write(Continuation *c, ink64 nbytes, IOBufferReader *buf, bool owner = false) = 0;
   void do_io_close(int lerrno = -1) = 0;
-  void reenable(VIO * avio) = 0;
-  void reenable_re(VIO * avio) = 0;
+  void reenable(VIO *avio) = 0;
+  void reenable_re(VIO *avio) = 0;
   void do_io_shutdown(ShutdownHowTo_t howto)
   {
     (void) howto;
@@ -140,8 +146,8 @@
   virtual int set_header(void *ptr, int len) = 0;
 
 #ifdef HTTP_CACHE
-  virtual void set_http_info(CacheHTTPInfo * info) = 0;
-  virtual void get_http_info(CacheHTTPInfo ** info) = 0;
+  virtual void set_http_info(CacheHTTPInfo *info) = 0;
+  virtual void get_http_info(CacheHTTPInfo **info) = 0;
 #endif
 
   virtual Action *action() = 0;

Modified: incubator/trafficserver/traffic/branches/dev/iocore/cache/I_CacheDefs.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cache/I_CacheDefs.h?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cache/I_CacheDefs.h (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cache/I_CacheDefs.h Mon Feb  1 23:06:01 2010
@@ -67,13 +67,8 @@
   CACHE_EVENT_OPEN_READ,
   CACHE_EVENT_OPEN_READ_FAILED,
   CACHE_EVENT_OPEN_READ_DONE,
-  CACHE_EVENT_OPEN_READ_FAILED_IN_PROGRESS,
-  CACHE_EVENT_OPEN_READ_VIO,
-  CACHE_EVENT_OPEN_READ_VIO_XXX,        // unused
   CACHE_EVENT_OPEN_WRITE,
   CACHE_EVENT_OPEN_WRITE_FAILED,
-  CACHE_EVENT_OPEN_WRITE_VIO,
-  CACHE_EVENT_OPEN_WRITE_VIO_XXX,       // unused
   CACHE_EVENT_REMOVE,
   CACHE_EVENT_REMOVE_FAILED,
   CACHE_EVENT_UPDATE,
@@ -126,6 +121,7 @@
 
 #define CacheKey INK_MD5
 #define CACHE_ALLOW_MULTIPLE_WRITES 1
+#define CACHE_EXPECTED_SIZE 32768
 
 /* uses of the CacheKey
    word(0) - cache partition segment

Modified: incubator/trafficserver/traffic/branches/dev/iocore/cache/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cache/Makefile.am?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cache/Makefile.am (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cache/Makefile.am Mon Feb  1 23:06:01 2010
@@ -30,6 +30,7 @@
   CachePart.cc \
   CacheRead.cc \
   CacheWrite.cc \
+  CacheTest.cc \
   I_Cache.h \
   I_CacheDefs.h \
   I_Store.h \

Modified: incubator/trafficserver/traffic/branches/dev/iocore/cache/P_CacheInternal.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cache/P_CacheInternal.h?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cache/P_CacheInternal.h (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cache/P_CacheInternal.h Mon Feb  1 23:06:01 2010
@@ -228,12 +228,12 @@
 {
   CacheVC();
 
-  VIO *do_io_read(Continuation * c, ink64 nbytes, MIOBuffer * buf);
+  VIO *do_io_read(Continuation *c, ink64 nbytes, MIOBuffer *buf);
   VIO *do_io_pread(Continuation *c, ink64 nbytes, MIOBuffer *buf, ink64 offset);
-  VIO *do_io_write(Continuation * c, ink64 nbytes, IOBufferReader * buf, bool owner = false);
+  VIO *do_io_write(Continuation *c, ink64 nbytes, IOBufferReader *buf, bool owner = false);
   void do_io_close(int lerrno = -1);
-  void reenable(VIO * avio);
-  void reenable_re(VIO * avio);
+  void reenable(VIO *avio);
+  void reenable_re(VIO *avio);
   bool get_data(int i, void *data);
   bool set_data(int i, void *data);
   Action *action()
@@ -262,57 +262,57 @@
   bool writer_done();
   int calluser(int event);
   int die();
-  int dead(int event, Event * e);
+  int dead(int event, Event *e);
 
-  int handleReadDone(int event, Event * e);
-  int handleRead(int event, Event * e);
-  int do_read_call(CacheKey * akey);
-  int handleWrite(int event, Event * e);
-  int handleWriteLock(int event, Event * e);
+  int handleReadDone(int event, Event *e);
+  int handleRead(int event, Event *e);
+  int do_read_call(CacheKey *akey);
+  int handleWrite(int event, Event *e);
+  int handleWriteLock(int event, Event *e);
   int do_write_call();
   int do_write_lock();
   int do_write_lock_call();
 
-  int openReadClose(int event, Event * e);
-  int openReadReadDone(int event, Event * e);
-  int openReadMain(int event, Event * e);
-  int openReadStartEarliest(int event, Event * e);
+  int openReadClose(int event, Event *e);
+  int openReadReadDone(int event, Event *e);
+  int openReadMain(int event, Event *e);
+  int openReadStartEarliest(int event, Event *e);
 #ifdef HTTP_CACHE
-  int openReadVecWrite(int event, Event * e);
+  int openReadVecWrite(int event, Event *e);
 #endif
-  int openReadStartHead(int event, Event * e);
-  int openReadFromWriter(int event, Event * e);
-  int openReadFromWriterMain(int event, Event * e);
+  int openReadStartHead(int event, Event *e);
+  int openReadFromWriter(int event, Event *e);
+  int openReadFromWriterMain(int event, Event *e);
   int openReadFromWriterFailure(int event, Event *);
-  int openReadChooseWriter(int event, Event * e);
+  int openReadChooseWriter(int event, Event *e);
 
-  int openWriteCloseDir(int event, Event * e);
-  int openWriteCloseHeadDone(int event, Event * e);
-  int openWriteCloseHead(int event, Event * e);
-  int openWriteCloseDataDone(int event, Event * e);
-  int openWriteClose(int event, Event * e);
-  int openWriteRemoveVector(int event, Event * e);
-  int openWriteWriteDone(int event, Event * e);
-  int openWriteOverwrite(int event, Event * e);
-  int openWriteMain(int event, Event * e);
-  int openWriteStartDone(int event, Event * e);
-  int openWriteStartBegin(int event, Event * e);
-
-  int updateVector(int event, Event * e);
-  int updateReadDone(int event, Event * e);
-
-  int updateVecWrite(int event, Event * e);
-  int removeReadDone(int event, Event * e);
-  int removeAbortWriter(int event, Event * e);
-
-  int linkWrite(int event, Event * e);
-  int derefRead(int event, Event * e);
-
-  int scanPart(int event, Event * e);
-  int scanObject(int event, Event * e);
-  int scanUpdateDone(int event, Event * e);
-  int scanOpenWrite(int event, Event * e);
-  int scanRemoveDone(int event, Event * e);
+  int openWriteCloseDir(int event, Event *e);
+  int openWriteCloseHeadDone(int event, Event *e);
+  int openWriteCloseHead(int event, Event *e);
+  int openWriteCloseDataDone(int event, Event *e);
+  int openWriteClose(int event, Event *e);
+  int openWriteRemoveVector(int event, Event *e);
+  int openWriteWriteDone(int event, Event *e);
+  int openWriteOverwrite(int event, Event *e);
+  int openWriteMain(int event, Event *e);
+  int openWriteStartDone(int event, Event *e);
+  int openWriteStartBegin(int event, Event *e);
+
+  int updateVector(int event, Event *e);
+  int updateReadDone(int event, Event *e);
+
+  int updateVecWrite(int event, Event *e);
+  int removeReadDone(int event, Event *e);
+  int removeAbortWriter(int event, Event *e);
+
+  int linkWrite(int event, Event *e);
+  int derefRead(int event, Event *e);
+
+  int scanPart(int event, Event *e);
+  int scanObject(int event, Event *e);
+  int scanUpdateDone(int event, Event *e);
+  int scanOpenWrite(int event, Event *e);
+  int scanRemoveDone(int event, Event *e);
 
   int is_io_in_progress()
   {
@@ -326,13 +326,13 @@
   {
     io.aiocb.aio_fildes = AIO_AGG_WRITE_IN_PROGRESS;
   }
-  int evacuateDocDone(int event, Event * e);
-  int evacuateReadHead(int event, Event * e);
+  int evacuateDocDone(int event, Event *e);
+  int evacuateReadHead(int event, Event *e);
 
   void cancel_trigger();
   virtual int get_object_size();
 #ifdef HTTP_CACHE
-  virtual void set_http_info(CacheHTTPInfo * info);
+  virtual void set_http_info(CacheHTTPInfo *info);
   virtual void get_http_info(CacheHTTPInfo ** info);
 #endif
   virtual bool set_pin_in_cache(time_t time_pin);
@@ -485,15 +485,15 @@
 // Function Prototypes
 #ifdef HTTP_CACHE
 int cache_write(CacheVC *, CacheHTTPInfoVector *);
-int get_alternate_index(CacheHTTPInfoVector * cache_vector, CacheKey key);
+int get_alternate_index(CacheHTTPInfoVector *cache_vector, CacheKey key);
 #endif
-int evacuate_segments(CacheKey * key, int force, Part * part);
-CacheVC *new_DocEvacuator(int nbytes, Part * d);
+int evacuate_segments(CacheKey *key, int force, Part *part);
+CacheVC *new_DocEvacuator(int nbytes, Part *d);
 
 // inline Functions
 
 inline CacheVC *
-new_CacheVC(Continuation * cont)
+new_CacheVC(Continuation *cont)
 {
   EThread *t = cont->mutex->thread_holding;
   CacheVC *c = THREAD_ALLOC(cacheVConnectionAllocator, t);
@@ -515,7 +515,7 @@
 }
 
 inline int
-free_CacheVC(CacheVC * cont)
+free_CacheVC(CacheVC *cont)
 {
   Debug("cache_free", "free %lX", (long) cont);
   ProxyMutex *mutex = cont->mutex;
@@ -586,7 +586,7 @@
 }
 
 inline int
-CacheVC::do_read_call(CacheKey * akey)
+CacheVC::do_read_call(CacheKey *akey)
 {
   doc_pos = 0;
   read_key = akey;
@@ -639,7 +639,7 @@
 }
 
 inline int
-CacheVC::handleWriteLock(int event, Event * e)
+CacheVC::handleWriteLock(int event, Event *e)
 {
   cancel_trigger();
   int ret = 0;
@@ -689,7 +689,7 @@
 }
 
 inline int
-Part::close_write(CacheVC * cont)
+Part::close_write(CacheVC *cont)
 {
 
 #ifdef CACHE_STAT_PAGES
@@ -702,7 +702,7 @@
 
 // Returns 0 on success or a positive error code on failure
 inline int
-Part::open_write(CacheVC * cont, int allow_if_writers, int max_writers)
+Part::open_write(CacheVC *cont, int allow_if_writers, int max_writers)
 {
   Part *part = this;
   bool agg_error = false;
@@ -729,7 +729,7 @@
 }
 
 inline int
-Part::close_write_lock(CacheVC * cont)
+Part::close_write_lock(CacheVC *cont)
 {
   EThread *t = cont->mutex->thread_holding;
   CACHE_TRY_LOCK(lock, mutex, t);
@@ -739,7 +739,7 @@
 }
 
 inline int
-Part::open_write_lock(CacheVC * cont, int allow_if_writers, int max_writers)
+Part::open_write_lock(CacheVC *cont, int allow_if_writers, int max_writers)
 {
   EThread *t = cont->mutex->thread_holding;
   CACHE_TRY_LOCK(lock, mutex, t);
@@ -749,7 +749,7 @@
 }
 
 inline OpenDirEntry *
-Part::open_read_lock(INK_MD5 * key, EThread * t)
+Part::open_read_lock(INK_MD5 *key, EThread *t)
 {
   CACHE_TRY_LOCK(lock, mutex, t);
   if (!lock)
@@ -758,7 +758,7 @@
 }
 
 inline int
-Part::begin_read_lock(CacheVC * cont)
+Part::begin_read_lock(CacheVC *cont)
 {
   // no need for evacuation as the entire document is already in memory
 #ifndef  CACHE_STAT_PAGES
@@ -774,7 +774,7 @@
 }
 
 inline int
-Part::close_read_lock(CacheVC * cont)
+Part::close_read_lock(CacheVC *cont)
 {
   EThread *t = cont->mutex->thread_holding;
   CACHE_TRY_LOCK(lock, mutex, t);
@@ -784,7 +784,7 @@
 }
 
 inline int
-dir_delete_lock(CacheKey * key, Part * d, ProxyMutex * m, Dir * del)
+dir_delete_lock(CacheKey *key, Part *d, ProxyMutex *m, Dir *del)
 {
   EThread *thread = m->thread_holding;
   CACHE_TRY_LOCK(lock, d->mutex, thread);
@@ -794,7 +794,7 @@
 }
 
 inline int
-dir_insert_lock(CacheKey * key, Part * d, Dir * to_part, ProxyMutex * m)
+dir_insert_lock(CacheKey *key, Part *d, Dir *to_part, ProxyMutex *m)
 {
   EThread *thread = m->thread_holding;
   CACHE_TRY_LOCK(lock, d->mutex, thread);
@@ -804,7 +804,7 @@
 }
 
 inline int
-dir_overwrite_lock(CacheKey * key, Part * d, Dir * to_part, ProxyMutex * m, Dir * overwrite, bool must_overwrite = true)
+dir_overwrite_lock(CacheKey *key, Part *d, Dir *to_part, ProxyMutex *m, Dir *overwrite, bool must_overwrite = true)
 {
   EThread *thread = m->thread_holding;
   CACHE_TRY_LOCK(lock, d->mutex, thread);
@@ -814,7 +814,7 @@
 }
 
 void inline
-rand_CacheKey(CacheKey * next_key, ProxyMutex * mutex)
+rand_CacheKey(CacheKey *next_key, ProxyMutex *mutex)
 {
   inku32 *b = (inku32 *) & next_key->b[0];
   InkRand & g = mutex->thread_holding->generator;
@@ -824,7 +824,7 @@
 
 extern inku8 CacheKey_next_table[];
 void inline
-next_CacheKey(CacheKey * next_key, CacheKey * key)
+next_CacheKey(CacheKey *next_key, CacheKey *key)
 {
   inku8 *b = (inku8 *) next_key;
   inku8 *k = (inku8 *) key;
@@ -834,7 +834,7 @@
 }
 extern inku8 CacheKey_prev_table[];
 void inline
-prev_CacheKey(CacheKey * prev_key, CacheKey * key)
+prev_CacheKey(CacheKey *prev_key, CacheKey *key)
 {
   inku8 *b = (inku8 *) prev_key;
   inku8 *k = (inku8 *) key;
@@ -865,7 +865,7 @@
 }
 
 inline void
-free_CacheRemoveCont(CacheRemoveCont * cache_rm)
+free_CacheRemoveCont(CacheRemoveCont *cache_rm)
 {
   cache_rm->mutex = NULL;
   cacheRemoveContAllocator.free(cache_rm);
@@ -909,43 +909,43 @@
   int open(bool reconfigure, bool fix);
   int close();
 
-  Action *lookup(Continuation * cont, CacheKey * key, CacheFragType type, char *hostname, int host_len);
-  inkcoreapi Action *open_read(Continuation * cont, CacheKey * key, CacheFragType type, char *hostname, int len);
-  inkcoreapi Action *open_write(Continuation * cont, CacheKey * key,
+  Action *lookup(Continuation *cont, CacheKey *key, CacheFragType type, char *hostname, int host_len);
+  inkcoreapi Action *open_read(Continuation *cont, CacheKey *key, CacheFragType type, char *hostname, int len);
+  inkcoreapi Action *open_write(Continuation *cont, CacheKey *key,
                                 CacheFragType frag_type, bool overwrite = false,
                                 time_t pin_in_cache = (time_t) 0, char *hostname = 0, int host_len = 0);
-  inkcoreapi Action *remove(Continuation * cont, CacheKey * key,
+  inkcoreapi Action *remove(Continuation *cont, CacheKey *key,
                             bool user_agents = true, bool link = false,
                             CacheFragType type = CACHE_FRAG_TYPE_HTTP, char *hostname = 0, int host_len = 0);
-  Action *scan(Continuation * cont, char *hostname = 0, int host_len = 0, int KB_per_second = 2500);
+  Action *scan(Continuation *cont, char *hostname = 0, int host_len = 0, int KB_per_second = 2500);
 
 #ifdef HTTP_CACHE
-  Action *lookup(Continuation * cont, URL * url, CacheFragType type);
-  inkcoreapi Action *open_read(Continuation * cont, CacheKey * key,
-                               CacheHTTPHdr * request,
-                               CacheLookupHttpConfig * params, CacheFragType type, char *hostname, int host_len);
-  Action *open_read(Continuation * cont, URL * url, CacheHTTPHdr * request,
-                    CacheLookupHttpConfig * params, CacheFragType type);
-  Action *open_write(Continuation * cont, CacheKey * key,
-                     CacheHTTPInfo * old_info, time_t pin_in_cache = (time_t) 0,
-                     CacheKey * key1 = NULL,
+  Action *lookup(Continuation *cont, URL *url, CacheFragType type);
+  inkcoreapi Action *open_read(Continuation *cont, CacheKey *key,
+                               CacheHTTPHdr *request,
+                               CacheLookupHttpConfig *params, CacheFragType type, char *hostname, int host_len);
+  Action *open_read(Continuation *cont, URL *url, CacheHTTPHdr *request,
+                    CacheLookupHttpConfig *params, CacheFragType type);
+  Action *open_write(Continuation *cont, CacheKey *key,
+                     CacheHTTPInfo *old_info, time_t pin_in_cache = (time_t) 0,
+                     CacheKey *key1 = NULL,
                      CacheFragType type = CACHE_FRAG_TYPE_HTTP, char *hostname = 0, int host_len = 0);
-  Action *open_write(Continuation * cont, URL * url, CacheHTTPHdr * request,
-                     CacheHTTPInfo * old_info, time_t pin_in_cache = (time_t) 0,
+  Action *open_write(Continuation *cont, URL *url, CacheHTTPHdr *request,
+                     CacheHTTPInfo *old_info, time_t pin_in_cache = (time_t) 0,
                      CacheFragType type = CACHE_FRAG_TYPE_HTTP);
-  Action *remove(Continuation * cont, URL * url, CacheFragType type);
-  static void generate_key(INK_MD5 * md5, URL * url, CacheHTTPHdr * request);
+  Action *remove(Continuation *cont, URL *url, CacheFragType type);
+  static void generate_key(INK_MD5 *md5, URL *url, CacheHTTPHdr *request);
 #endif
 
-  Action *link(Continuation * cont, CacheKey * from, CacheKey * to, CacheFragType type, char *hostname, int host_len);
-  Action *deref(Continuation * cont, CacheKey * key, CacheFragType type, char *hostname, int host_len);
+  Action *link(Continuation *cont, CacheKey *from, CacheKey *to, CacheFragType type, char *hostname, int host_len);
+  Action *deref(Continuation *cont, CacheKey *key, CacheFragType type, char *hostname, int host_len);
 
   void part_initialized(bool result);
 
   int open_done();
-  static void print_stats(FILE * fp, int verbose = 0);
+  static void print_stats(FILE *fp, int verbose = 0);
 
-  Part *key_to_part(CacheKey * key, char *hostname, int host_len);
+  Part *key_to_part(CacheKey *key, char *hostname, int host_len);
 
   Cache():cache_read_done(0), total_good_npart(0), total_npart(0), ready(CACHE_INITIALIZING), cache_size(0),  // in store block size
           hosttable(NULL), total_initialized_part(0), scheme(CACHE_NONE_TYPE)
@@ -961,8 +961,8 @@
 
 #ifdef HTTP_CACHE
 inline Action *
-Cache::open_read(Continuation * cont, CacheURL * url, CacheHTTPHdr * request,
-                 CacheLookupHttpConfig * params, CacheFragType type)
+Cache::open_read(Continuation *cont, CacheURL *url, CacheHTTPHdr *request,
+                 CacheLookupHttpConfig *params, CacheFragType type)
 {
   INK_MD5 md5;
   int len;
@@ -972,7 +972,7 @@
 }
 
 inline void
-Cache::generate_key(INK_MD5 * md5, URL * url, CacheHTTPHdr * request)
+Cache::generate_key(INK_MD5 *md5, URL *url, CacheHTTPHdr *request)
 {
 #ifdef BROKEN_HACK_FOR_VARY_ON_UA
   // We probably should make this configurable, both enabling it and what
@@ -1017,8 +1017,8 @@
 }
 
 inline Action *
-Cache::open_write(Continuation * cont, CacheURL * url, CacheHTTPHdr * request,
-                  CacheHTTPInfo * old_info, time_t pin_in_cache, CacheFragType type)
+Cache::open_write(Continuation *cont, CacheURL *url, CacheHTTPHdr *request,
+                  CacheHTTPInfo *old_info, time_t pin_in_cache, CacheFragType type)
 {
   (void) request;
   INK_MD5 url_md5;
@@ -1050,7 +1050,7 @@
 #endif
 
 inline Action *
-CacheProcessor::lookup(Continuation * cont, CacheKey * key, bool local_only,
+CacheProcessor::lookup(Continuation *cont, CacheKey *key, bool local_only,
                        CacheFragType frag_type, char *hostname, int host_len)
 {
   (void) local_only;
@@ -1067,7 +1067,7 @@
 }
 
 inline inkcoreapi Action *
-CacheProcessor::open_read(Continuation * cont, CacheKey * key, CacheFragType frag_type, char *hostname, int host_len)
+CacheProcessor::open_read(Continuation *cont, CacheKey *key, CacheFragType frag_type, char *hostname, int host_len)
 {
 #ifdef CLUSTER_CACHE
   if (cache_clustering_enabled > 0) {
@@ -1080,7 +1080,7 @@
 }
 
 inline Action *
-CacheProcessor::open_read_buffer(Continuation * cont, MIOBuffer * buf, CacheKey * key, CacheFragType frag_type,
+CacheProcessor::open_read_buffer(Continuation *cont, MIOBuffer *buf, CacheKey *key, CacheFragType frag_type,
                                  char *hostname, int host_len)
 {
   (void) buf;
@@ -1096,8 +1096,9 @@
 
 
 inline inkcoreapi Action *
-CacheProcessor::open_write(Continuation * cont, int expected_size, CacheKey * key,
-                           CacheFragType frag_type, bool overwrite, time_t pin_in_cache, char *hostname, int host_len)
+CacheProcessor::open_write(Continuation *cont, CacheKey *key, CacheFragType frag_type, 
+                           int expected_size, bool overwrite, time_t pin_in_cache, 
+                           char *hostname, int host_len)
 {
   (void) expected_size;
 #ifdef CLUSTER_CACHE
@@ -1115,22 +1116,25 @@
 }
 
 inline Action *
-CacheProcessor::open_write_buffer(Continuation * cont, MIOBuffer * buf, CacheKey * key, bool overwrite,
-                                  CacheFragType frag_type, char *hostname, int host_len)
-{
-  (void) cont;
-  (void) buf;
-  (void) key;
-  (void) overwrite;
-  (void) frag_type;
-  (void) host_len;
-  (void) hostname;
+CacheProcessor::open_write_buffer(Continuation *cont, MIOBuffer *buf,
+                                  CacheKey *key, 
+                                  CacheFragType frag_type, 
+                                  bool overwrite, time_t pin_in_cache,
+                                  char *hostname, int host_len) 
+{
+  (void)cont;
+  (void)buf;
+  (void)key;
+  (void)frag_type;
+  (void)overwrite;
+  (void)hostname;
+  (void)host_len;
   ink_assert(!"implemented");
   return NULL;
 }
 
 inline Action *
-CacheProcessor::remove(Continuation * cont, CacheKey * key,
+CacheProcessor::remove(Continuation *cont, CacheKey *key,
                        bool rm_user_agents, bool rm_link, CacheFragType frag_type, char *hostname, int host_len)
 {
 #ifdef CLUSTER_CACHE
@@ -1146,14 +1150,14 @@
 }
 
 inline Action *
-scan(Continuation * cont, char *hostname = 0, int host_len = 0, int KB_per_second = 2500)
+scan(Continuation *cont, char *hostname = 0, int host_len = 0, int KB_per_second = 2500)
 {
   return caches[CACHE_FRAG_TYPE_HTTP]->scan(cont, hostname, host_len, KB_per_second);
 }
 
 #ifdef HTTP_CACHE
 inline Action *
-CacheProcessor::lookup(Continuation * cont, URL * url, bool local_only, CacheFragType frag_type)
+CacheProcessor::lookup(Continuation *cont, URL *url, bool local_only, CacheFragType frag_type)
 {
   (void) local_only;
   INK_MD5 md5;
@@ -1167,8 +1171,8 @@
 
 
 inline Action *
-CacheProcessor::open_read_buffer(Continuation * cont, MIOBuffer * buf,
-                                 URL * url, CacheHTTPHdr * request, CacheLookupHttpConfig * params, CacheFragType type)
+CacheProcessor::open_read_buffer(Continuation *cont, MIOBuffer *buf,
+                                 URL *url, CacheHTTPHdr *request, CacheLookupHttpConfig *params, CacheFragType type)
 {
   (void) buf;
 #ifdef CLUSTER_CACHE
@@ -1181,6 +1185,7 @@
 }
 
 
+
 inline Action *
 CacheProcessor::open_write_buffer(Continuation * cont, MIOBuffer * buf, URL * url,
                                   CacheHTTPHdr * request, CacheHTTPHdr * response, CacheFragType type)
@@ -1202,11 +1207,11 @@
 #ifdef CLUSTER_CACHE
 inline Action *
 CacheProcessor::open_read_internal(int opcode,
-                                   Continuation * cont, MIOBuffer * buf,
-                                   CacheURL * url,
-                                   CacheHTTPHdr * request,
-                                   CacheLookupHttpConfig * params,
-                                   CacheKey * key,
+                                   Continuation *cont, MIOBuffer *buf,
+                                   CacheURL *url,
+                                   CacheHTTPHdr *request,
+                                   CacheLookupHttpConfig *params,
+                                   CacheKey *key,
                                    time_t pin_in_cache, CacheFragType frag_type, char *hostname, int host_len)
 {
   INK_MD5 url_md5;
@@ -1234,7 +1239,7 @@
 
 #ifdef CLUSTER_CACHE
 inline Action *
-CacheProcessor::link(Continuation * cont, CacheKey * from, CacheKey * to,
+CacheProcessor::link(Continuation *cont, CacheKey *from, CacheKey *to,
                      CacheFragType type, char *hostname, int host_len)
 {
   if (cache_clustering_enabled > 0) {
@@ -1248,7 +1253,7 @@
 }
 
 inline Action *
-CacheProcessor::deref(Continuation * cont, CacheKey * key, CacheFragType type, char *hostname, int host_len)
+CacheProcessor::deref(Continuation *cont, CacheKey *key, CacheFragType type, char *hostname, int host_len)
 {
   if (cache_clustering_enabled > 0) {
     ClusterMachine *m = cluster_machine_at_depth(cache_hash(*key));
@@ -1261,7 +1266,7 @@
 #endif
 
 inline Action *
-CacheProcessor::scan(Continuation * cont, char *hostname, int host_len, int KB_per_second)
+CacheProcessor::scan(Continuation *cont, char *hostname, int host_len, int KB_per_second)
 {
   return caches[CACHE_FRAG_TYPE_HTTP]->scan(cont, hostname, host_len, KB_per_second);
 }

Modified: incubator/trafficserver/traffic/branches/dev/iocore/cache/P_CacheTest.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cache/P_CacheTest.h?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cache/P_CacheTest.h (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cache/P_CacheTest.h Mon Feb  1 23:06:01 2010
@@ -25,196 +25,65 @@
 #define __P_CACHE_TEST_H__
 
 #include "P_Cache.h"
+#include "RegressionSM.h"
 
 #define MAX_HOSTS_POSSIBLE 256
-
 #define PINNED_DOC_TABLE_SIZE 16
-
 #define PINNED_DOC_TABLES 246
 
-
 struct PinnedDocEntry
 {
-
   CacheKey key;
   ink_time_t time;
-    Link<PinnedDocEntry> link;
+  Link<PinnedDocEntry> link;
 };
 
-struct PinnedDocTable:public Continuation
+struct PinnedDocTable:Continuation
 {
-
   Queue<PinnedDocEntry> bucket[PINNED_DOC_TABLE_SIZE];
 
-  PinnedDocTable():Continuation(new_ProxyMutex())
-  {
-    memset(bucket, 0, sizeof(Queue<PinnedDocEntry>) * PINNED_DOC_TABLE_SIZE);
-  }
-
   void insert(CacheKey * key, ink_time_t time, int update);
   int probe(CacheKey * key);
   int remove(CacheKey * key);
   int cleanup(int event, Event * e);
-};
 
-class CacheTestHost
-{
-public:
+  PinnedDocTable():Continuation(new_ProxyMutex()) {
+    memset(bucket, 0, sizeof(Queue<PinnedDocEntry>) * PINNED_DOC_TABLE_SIZE);
+  }
+};
 
+struct CacheTestHost {
   char *name;
   volatile unsigned int xlast_cachable_id;
   volatile unsigned int xlast_ftp_cachable_id;
   double xprev_host_prob;
   double xnext_host_prob;
 
-    CacheTestHost():name(NULL), xlast_cachable_id(0), xlast_ftp_cachable_id(0), xprev_host_prob(0), xnext_host_prob(0)
-  {
-  }
-};
-
-class CacheSMTest;
-
-class CacheTestControl:public Continuation
-{
-public:
-  CacheTestControl();
-  ~CacheTestControl();
-
-  int open(const char *path);
-  int parse(const char *buf, int length);
-  int get_token(const char *&buf, int &length, char **token_start, char **token_end);
-  int get_left_paren(const char *&buf, int &length);
-  int get_right_paren(const char *&buf, int &length);
-  int get_float(const char *&buf, int &length, double *val);
-  int get_integer(const char *&buf, int &length, int *val);
-  int get_string(const char *&buf, int &length, char str[1024]);
-  int get_symbol(const char *&buf, int &length, char symbol[1024]);
-
-  int users();
-  int buffer_size();
-  int get_request(CacheSMTest * test, char *buffer, int size);
-
-  void lookup_success(ink_hrtime elapsed);
-  void lookup_failure(ink_hrtime elapsed);
-  void read_success(ink_hrtime elapsed, int bytes);
-  void read_failure();
-  void vc_read_failure();
-  void write_success(ink_hrtime elapsed, int bytes);
-  void write_failure();
-  void aio_success(ink_hrtime elapsed);
-  void vc_write_failure();
-  void update_success();
-  void update_failure();
-  void vc_update_failure();
-  void pin_success();
-  void pin_failure();
-  PinnedDocTable *getPinnedTable(INK_MD5 * md5);
-
-  void rw_failure();
-  int print_stats_event(int event, void *edata);
-  int print_stats(void);
-
-public:
-    ink_hrtime start_time;
-  ink_hrtime last_time;
-
-  int xusers;
-  volatile int xstate_machines;
-  volatile int xrequests;
-  int xbuffer_size;
-  int xaverage_over;
-  int xwarmup;
-  int xrun_length;
-  int xmean_doc_size;
-  int xnum_hosts;
-  CacheTestHost host_array[MAX_HOSTS_POSSIBLE];
-  volatile unsigned int xlast_cachable_id;
-  volatile unsigned int xlast_ftp_cachable_id;
-  double xhotset_probability;
-  double xremove_probability;
-  double xupdate_probability;
-  double xpure_update_probability;
-  double xcancel_probability;
-  double xabort_probability;
-  double xhttp_req_probability;
-  int xnum_alternates;
-  int xcheck_content;
-  int xfill_cache;
-  int xaio_test;
-  double xpin_percent;
-  int xmean_pin_time;
-  PinnedDocTable *pin_tables[PINNED_DOC_TABLES];
-  double last_elapsed;
-  int n_average;
-  double avg_ops_sec;
-  double avg_aio_ops_sec;
-  volatile int lookup_successes;
-  volatile int lookup_failures;
-  volatile ink64 lookup_hit_time;
-  volatile ink64 lookup_miss_time;
-  volatile int read_successes;
-  int lread_successes;
-  volatile int read_failures;
-  volatile int vc_read_failures;
-  volatile ink64 read_bytes;
-  volatile ink64 read_time;
-  volatile int write_successes;
-  int lwrite_successes;
-  volatile int write_failures;
-  volatile int aio_successes;
-  int laio_successes;
-  volatile ink64 aio_time;
-  volatile int vc_write_failures;
-  volatile ink64 write_bytes;
-  volatile ink64 write_time;
-  volatile int update_successes;
-  volatile int update_failures;
-  volatile int vc_update_failures;
-  volatile int pin_failures;
-  volatile int pin_successes;
-  volatile int pin_writes;
-  volatile int rw_failures;
-  Event *trigger;
+  CacheTestHost():name(NULL), xlast_cachable_id(0), xlast_ftp_cachable_id(0), 
+                  xprev_host_prob(0), xnext_host_prob(0) {}
 };
 
-int runCacheTest();
-int runCacheTest(CacheTestControl *);
-
-
-
-class CacheSMTest:public Continuation
-{
-public:
-  CacheSMTest(CacheTestControl * xcontrol, int xid);
-   ~CacheSMTest();
+struct CacheTestSM;
 
-  void make_request();
-  void fill_buffer();
-  void check_buffer();
-  int event_handler(int event, void *edata);
-
-public:
-    Action * timeout;
+struct CacheTestSM : RegressionSM {
+  Action *timeout;
   Action *cache_action;
   ink_hrtime start_time;
-  CacheTestControl *control;
   CacheVConnection *cache_vc;
+  VIO *cvio;
   MIOBuffer *buffer;
   IOBufferReader *buffer_reader;
 #ifdef HTTP_CACHE
   CacheLookupHttpConfig params;
   CacheHTTPInfo info;
-#endif
   char urlstr[1024];
-  int iterations;
-  int request_size;
-  int total_size;
-  int done_size;
-  int buffer_size_index;
-  int idx;
-  int id;
-  INK_MD5 md5;
-  ink_time_t pin_in_cache;
+#endif
+  ink64 total_size;
+  CacheKey key;
+  int repeat_count;
+  int expect_event;
+  int expect_initial_event;
+  int initial_event;
   union
   {
     unsigned int flags;
@@ -227,8 +96,41 @@
       unsigned int remove:1;
     } f;
   };
-  Event *m_timeout;
+
+  void fill_buffer();
+  int check_buffer();
+  int check_result(int event);
+  int complete(int event);
+  int event_handler(int event, void *edata);
+  void make_request() {
+    start_time = ink_get_hrtime();
+    make_request_internal();
+  }
+  virtual void make_request_internal() = 0;
+
+  void cancel_timeout() {
+    if (timeout) timeout->cancel();
+    timeout = 0;
+  }
+
+  // RegressionSM API
+  void run() { MUTEX_LOCK(lock, mutex, this_ethread()); timeout = eventProcessor.schedule_imm(this); }
+  virtual RegressionSM *clone() = 0;
+
+  CacheTestSM(RegressionTest *t);
+  CacheTestSM(const CacheTestSM &ao);
+  ~CacheTestSM();
 };
 
+// It is 2010 and C++ STILL doesn't have closures, a technology of the 1950s, unbelievable
+#define CACHE_SM(_t, _sm, _f)                \
+  struct CacheTestSM__##_sm : CacheTestSM { \
+    void make_request_internal() _f \
+    CacheTestSM__##_sm(RegressionTest *t) : CacheTestSM(t) {} \
+    CacheTestSM__##_sm(const CacheTestSM__##_sm &xsm) : CacheTestSM(xsm) {} \
+    RegressionSM *clone() { return new CacheTestSM__##_sm(*this); } \
+} _sm(_t);
+
+extern int cache_regression_test;
 
 #endif /* __P_CACHE_TEST_H__ */

Modified: incubator/trafficserver/traffic/branches/dev/iocore/cache/RamCache.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cache/RamCache.cc?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cache/RamCache.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cache/RamCache.cc Mon Feb  1 23:06:01 2010
@@ -47,7 +47,7 @@
   partition_size = aobjects / n_partitions;
   cutoff_size = cutoff;
 
-  Debug("ram_cache", "initializing ram_cache, partition_size=%d, aobjects=%d, abytes=%d",
+  DDebug("ram_cache", "initializing ram_cache, partition_size=%d, aobjects=%d, abytes=%d",
         partition_size, aobjects, abytes);
   /* equivalent to ram cache disabled */
   if (partition_size == 0)
@@ -93,12 +93,12 @@
       p->lru.remove(e, e->lru_link);
       p->lru.enqueue(e, e->lru_link);
       (*ret_data) = e->data;
-      Debug("ram_cache", "get %X %d %d HIT", k, auxkey1, auxkey2);
+      DDebug("ram_cache", "get %X %d %d HIT", k, auxkey1, auxkey2);
       return 1;
     }
     e = e->hash_link.next;
   }
-  Debug("ram_cache", "get %X %d %d MISS", k, auxkey1, auxkey2);
+  DDebug("ram_cache", "get %X %d %d MISS", k, auxkey1, auxkey2);
   return 0;
 }
 
@@ -124,7 +124,7 @@
   p->cur_bytes -= ee->data->block_size();
   ProxyMutex *mutex = part->mutex;
   CACHE_SUM_DYN_STAT(cache_ram_cache_bytes_stat, -ee->data->block_size());
-  Debug("ram_cache", "put %X %d %d FREED", ee->key.word(3), ee->auxkey1, ee->auxkey2);
+  DDebug("ram_cache", "put %X %d %d FREED", ee->key.word(3), ee->auxkey1, ee->auxkey2);
   free_RamCacheEntry(ee, t);
 }
 
@@ -149,7 +149,7 @@
   unsigned short oldseen = p->seen[s];
   p->seen[s] = (unsigned short) k3;
   if ((oldseen != (unsigned short) k3) && bytes <= p->cur_bytes + RAM_CACHE_FAST_LOAD_SIZE) {
-    Debug("ram_cache", "put %X %d %d FIRST SEEN", k, auxkey1, auxkey2);
+    DDebug("ram_cache", "put %X %d %d FIRST SEEN", k, auxkey1, auxkey2);
     return 0;
   }
 
@@ -158,7 +158,7 @@
     RamCacheEntry *n = e->hash_link.next;
     if (e->key == *key) {
       if (e->auxkey1 == auxkey1 && e->auxkey2 == auxkey2) {
-        Debug("ram_cache", "put %X %d %d PRESENT", k, auxkey1, auxkey2);
+        DDebug("ram_cache", "put %X %d %d PRESENT", k, auxkey1, auxkey2);
         return 1;               // already present
       } else {
         p->lru.remove(e, e->lru_link);
@@ -185,7 +185,7 @@
     else
       break;
   }
-  Debug("ram_cache", "put %X %d %d INSERTED", k, auxkey1, auxkey2);
+  DDebug("ram_cache", "put %X %d %d INSERTED", k, auxkey1, auxkey2);
   return 1;
 }
 
@@ -208,7 +208,7 @@
   /* equivalent to ram cache disabled */
   if (partition_size == 0)
     return 0;
-  Debug("ram_cache", "fixup %d", key);
+  DDebug("ram_cache", "fixup %d", key);
   inku32 k = key->word(3);
   inku32 pp = k % n_partitions;
   RamCachePartition *p = &partition[pp];

Modified: incubator/trafficserver/traffic/branches/dev/iocore/cluster/ClusterCache.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cluster/ClusterCache.cc?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cluster/ClusterCache.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cluster/ClusterCache.cc Mon Feb  1 23:06:01 2010
@@ -1596,14 +1596,6 @@
       return handleEvent(event, vc);
       break;
     }
-  case CACHE_EVENT_OPEN_READ_FAILED_IN_PROGRESS:
-    {
-      // open read in-progress, just deflect to final completion handler
-
-      SET_HANDLER((CacheContHandler) & CacheContinuation::replyOpEvent);
-      return handleEvent(event, vc);
-      break;
-    }
   case CACHE_EVENT_OPEN_READ_FAILED:
     {
       if (frag_type == CACHE_FRAG_TYPE_HTTP) {
@@ -2034,7 +2026,6 @@
     case CACHE_EVENT_LINK_FAILED:
       break;
     case CACHE_EVENT_OPEN_READ_FAILED:
-    case CACHE_EVENT_OPEN_READ_FAILED_IN_PROGRESS:
     case CACHE_EVENT_OPEN_WRITE_FAILED:
     case CACHE_EVENT_REMOVE_FAILED:
     case CACHE_EVENT_UPDATE_FAILED:

Modified: incubator/trafficserver/traffic/branches/dev/iocore/cluster/P_ClusterCacheInternal.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/iocore/cluster/P_ClusterCacheInternal.h?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/iocore/cluster/P_ClusterCacheInternal.h (original)
+++ incubator/trafficserver/traffic/branches/dev/iocore/cluster/P_ClusterCacheInternal.h Mon Feb  1 23:06:01 2010
@@ -812,7 +812,6 @@
   case CACHE_EVENT_LINK:
   case CACHE_EVENT_LINK_FAILED:
   case CACHE_EVENT_OPEN_READ_FAILED:
-  case CACHE_EVENT_OPEN_READ_FAILED_IN_PROGRESS:
   case CACHE_EVENT_OPEN_WRITE_FAILED:
   case CACHE_EVENT_REMOVE_FAILED:
   case CACHE_EVENT_UPDATE_FAILED:
@@ -829,7 +828,6 @@
   switch (event) {
   case CACHE_EVENT_LOOKUP_FAILED:
   case CACHE_EVENT_OPEN_READ_FAILED:
-  case CACHE_EVENT_OPEN_READ_FAILED_IN_PROGRESS:
   case CACHE_EVENT_OPEN_WRITE_FAILED:
   case CACHE_EVENT_UPDATE_FAILED:
   case CACHE_EVENT_REMOVE_FAILED:

Modified: incubator/trafficserver/traffic/branches/dev/libinktomi++/INK_MD5.h
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/libinktomi%2B%2B/INK_MD5.h?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/libinktomi++/INK_MD5.h (original)
+++ incubator/trafficserver/traffic/branches/dev/libinktomi++/INK_MD5.h Mon Feb  1 23:06:01 2010
@@ -34,7 +34,7 @@
 struct INK_MD5
 {
   inku64 b[2];
-    INK_MD5 & operator =(INK_MD5 & md5)
+  const INK_MD5 & operator =(const INK_MD5 & md5)
   {
     b[0] = md5.b[0];
     b[1] = md5.b[1];

Modified: incubator/trafficserver/traffic/branches/dev/proxy/EventName.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/EventName.cc?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/EventName.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/EventName.cc Mon Feb  1 23:06:01 2010
@@ -26,6 +26,17 @@
 #include <stdio.h>
 #include <string.h>
 
+#include "P_EventSystem.h"
+// #include "I_Disk.h" unused
+// #include "I_NNTP.h" unavailable
+// #include "I_FTP.h" unavailable
+#include "I_Cache.h"
+#include "I_Net.h"
+#include "P_Cluster.h"
+#include "I_HostDB.h"
+#include "BaseManager.h"
+#include "P_MultiCache.h"
+
 /*------------------------------------------------------------------------- 
   event_int_to_string
 
@@ -39,208 +50,114 @@
 event_int_to_string(int event, char buffer[32])
 {
   switch (event) {
-  case -1:
-    return "<no event>";
-  case 100:
-    return "VC_EVENT_READ_READY";
-  case 101:
-    return "VC_EVENT_WRITE_READY";
-  case 102:
-    return "VC_EVENT_READ_COMPLETE";
-  case 103:
-    return "VC_EVENT_WRITE_COMPLETE";
-  case 104:
-    return "VC_EVENT_EOS";
-  case 105:
-    return "VC_EVENT_INACTIVITY_TIMEOUT";
-  case 106:
-    return "VC_EVENT_ACTIVE_TIMEOUT";
-
-  case 200:
-    return "NET_EVENT_OPEN";
-  case 201:
-    return "NET_EVENT_OPEN_FAILED";
-  case 202:
-    return "NET_EVENT_ACCEPT";
-  case 203:
-    return "NET_EVENT_ACCEPT_SUCCEED";
-  case 204:
-    return "NET_EVENT_ACCEPT_FAILED";
-
-  case 300:
-    return "DISK_EVENT_OPEN";
-  case 301:
-    return "DISK_EVENT_OPEN_FAILED";
-  case 304:
-    return "DISK_EVENT_CLOSE_COMPLETE";
-  case 305:
-    return "DISK_EVENT_STAT_COMPLETE";
-  case 306:
-    return "DISK_EVENT_SEEK_COMPLETE";
-
-  case 400:
-    return "CLUSTER_EVENT_CHANGE";
-  case 401:
-    return "CLUSTER_EVENT_CONFIGURATION";
-  case 402:
-    return "CLUSTER_EVENT_OPEN";
-  case 403:
-    return "CLUSTER_EVENT_OPEN_FAILED";
-  case 450:
-    return "CLUSTER_EVENT_STEAL_THREAD";
-
-  case 500:
-    return "EVENT_HOST_DB_LOOKUP";
-  case 501:
-    return "EVENT_HOST_DB_GET_RESPONSE";
-
-  case 600:
-    return "DNS_EVENT_EVENTS_START";
-
-  case 700:
-    return "FTP_EVENT_OPEN";
-  case 701:
-    return "FTP_EVENT_ACCEPT";
-  case 702:
-    return "FTP_EVENT_OPEN_FAILED";
-
-  case 800:
-    return "MANAGEMENT_EVENT";
-
-  case 900:
-    return "LOGIO_FINISHED";
-  case 901:
-    return "LOGIO_WRITE";
-  case 902:
-    return "LOGIO_COUNTEDWRITE";
-  case 903:
-    return "LOGIO_HAVENETIO";
-  case 904:
-    return "LOGIO_RECONFIG";
-  case 905:
-    return "LOGIO_RECONFIG_FILE";
-  case 906:
-    return "LOGIO_RECONFIG_FILEREAD";
-  case 907:
-    return "LOGIO_PULSE";
-  case 908:
-    return "LOGIO_STARTUP";
-
-  case 1000:
-    return "MULTI_CACHE_EVENT_SYNC";
-
-  case 1100:
-    return "CACHE_EVENT_LOOKUP";
-  case 1101:
-    return "CACHE_EVENT_LOOKUP_FAILED";
-  case 1102:
-    return "CACHE_EVENT_OPEN_READ";
-  case 1103:
-    return "CACHE_EVENT_OPEN_READ_FAILED";
-  case 1104:
-    return "CACHE_EVENT_OPEN_READ_DUMMY";
-  case 1105:
-    return "CACHE_EVENT_OPEN_READ_FAILED_IN_PROGRESS";
-  case 1106:
-    return "CACHE_EVENT_OPEN_READ_VIO";
-  case 1107:
-    return "CACHE_EVENT_OPEN_READ_VIO_XXX";
-  case 1108:
-    return "CACHE_EVENT_OPEN_WRITE";
-  case 1109:
-    return "CACHE_EVENT_OPEN_WRITE_FAILED";
-  case 1110:
-    return "CACHE_EVENT_OPEN_WRITE_VIO";
-  case 1111:
-    return "CACHE_EVENT_OPEN_WRITE_VIO_XXX";
-  case 1112:
-    return "CACHE_EVENT_REMOVE";
-  case 1113:
-    return "CACHE_EVENT_REMOVE_FAILED";
-  case 1114:
-    return "CACHE_EVENT_UPDATE";
-  case 1115:
-    return "CACHE_EVENT_UPDATE_FAILED";
-  case 1116:
-    return "CACHE_EVENT_LINK";
-  case 1117:
-    return "CACHE_EVENT_LINK_FAILED";
-  case 1118:
-    return "CACHE_EVENT_DEREF";
-  case 1119:
-    return "CACHE_EVENT_DEREF_FAILED";
-  case 1150:
-    return "CACHE_EVENT_RESPONSE";
-  case 1151:
-    return "CACHE_EVENT_RESPONSE_MSG";
-
-  case 1300:
-    return "CACHE_DB_EVENT_POOL_SYNC";
-  case 1301:
-    return "CACHE_DB_EVENT_ITERATE_VECVEC";
-  case 1302:
-    return "CACHE_DB_EVENT_ITERATE_FRAG_HDR";
-  case 1303:
-    return "CACHE_DB_EVENT_ITERATE_DONE";
-
-  case 1500:
-    return "HTTP_EVENT_CONNECTION_OPEN";
-  case 1501:
-    return "HTTP_EVENT_CONNECTION_OPEN_ERROR";
-  case 1502:
-    return "HTTP_EVENT_READ_HEADER_COMPLETE";
-  case 1503:
-    return "HTTP_EVENT_READ_HEADER_ERROR";
-  case 1504:
-    return "HTTP_EVENT_READ_BODY_READY";
-  case 1505:
-    return "HTTP_EVENT_READ_BODY_COMPLETE";
-  case 1506:
-    return "HTTP_EVENT_WRITE_READY";
-  case 1507:
-    return "HTTP_EVENT_WRITE_COMPLETE";
-  case 1508:
-    return "HTTP_EVENT_EOS";
-  case 1509:
-    return "HTTP_EVENT_CLOSED";
-
-  case 1700:
-    return "NNTP_EVENT_CMD";
-  case 1701:
-    return "NNTP_EVENT_CALL";
-  case 1702:
-    return "NNTP_EVENT_CALL_DONE";
-  case 1703:
-    return "NNTP_EVENT_ACQUIRE";
-  case 1704:
-    return "NNTP_EVENT_ACQUIRE_FAILED";
-  case 1705:
-    return "NNTP_EVENT_SLAVE_RESPONSE";
-  case 1706:
-    return "NNTP_EVENT_SLAVE_INITIAL_ERROR";
-  case 1707:
-    return "NNTP_EVENT_SLAVE_ERROR";
-  case 1708:
-    return "NNTP_EVENT_SLAVE_DONE";
-  case 1709:
-    return "NNTP_EVENT_TUNNEL_DONE";
-  case 1710:
-    return "NNTP_EVENT_TUNNEL_ERROR";
-  case 1711:
-    return "NNTP_EVENT_TUNNEL_CONT";
-  case 1712:
-    return "NNTP_EVENT_CLUSTER_MSG";
-
-  case 10000:
-    return "MGMT_EVENT_SHUTDOWN";
-  case 10001:
-    return "MGMT_EVENT_RESTART";
-  case 10002:
-    return "MGMT_EVENT_BOUNCE";
-  case 10003:
-    return "MGMT_EVENT_CONFIG_FILE_UPDATE";
-  case 10004:
-    return "MGMT_EVENT_CLEAR_STATS";
+    case -1: return "<no event>";
+    case VC_EVENT_READ_READY: return "VC_EVENT_READ_READY";
+    case VC_EVENT_WRITE_READY: return "VC_EVENT_WRITE_READY";
+    case VC_EVENT_READ_COMPLETE: return "VC_EVENT_READ_COMPLETE";
+    case VC_EVENT_WRITE_COMPLETE: return "VC_EVENT_WRITE_COMPLETE";
+    case VC_EVENT_EOS: return "VC_EVENT_EOS";
+    case VC_EVENT_INACTIVITY_TIMEOUT: return "VC_EVENT_INACTIVITY_TIMEOUT";
+    case VC_EVENT_ACTIVE_TIMEOUT: return "VC_EVENT_ACTIVE_TIMEOUT";
+
+    case NET_EVENT_OPEN: return "NET_EVENT_OPEN";
+    case NET_EVENT_OPEN_FAILED: return "NET_EVENT_OPEN_FAILED";
+    case NET_EVENT_ACCEPT: return "NET_EVENT_ACCEPT";
+    case NET_EVENT_ACCEPT_SUCCEED: return "NET_EVENT_ACCEPT_SUCCEED";
+    case NET_EVENT_ACCEPT_FAILED: return "NET_EVENT_ACCEPT_FAILED";
+
+#if 0
+    case DISK_EVENT_OPEN: return "DISK_EVENT_OPEN";
+    case DISK_EVENT_OPEN_FAILED: return "DISK_EVENT_OPEN_FAILED";
+    case DISK_EVENT_CLOSE_COMPLETE: return "DISK_EVENT_CLOSE_COMPLETE";
+    case DISK_EVENT_STAT_COMPLETE: return "DISK_EVENT_STAT_COMPLETE";
+    case DISK_EVENT_SEEK_COMPLETE: return "DISK_EVENT_SEEK_COMPLETE";
+#endif
+
+    case CLUSTER_EVENT_CHANGE: return "CLUSTER_EVENT_CHANGE";
+    case CLUSTER_EVENT_CONFIGURATION: return "CLUSTER_EVENT_CONFIGURATION";
+    case CLUSTER_EVENT_OPEN: return "CLUSTER_EVENT_OPEN";
+    case CLUSTER_EVENT_OPEN_FAILED: return "CLUSTER_EVENT_OPEN_FAILED";
+    case CLUSTER_EVENT_STEAL_THREAD: return "CLUSTER_EVENT_STEAL_THREAD";
+
+    case EVENT_HOST_DB_LOOKUP: return "EVENT_HOST_DB_LOOKUP";
+    case EVENT_HOST_DB_GET_RESPONSE: return "EVENT_HOST_DB_GET_RESPONSE";
+
+    case DNS_EVENT_EVENTS_START: return "DNS_EVENT_EVENTS_START";
+
+#if 0
+    case FTP_EVENT_OPEN: return "FTP_EVENT_OPEN";
+    case FTP_EVENT_ACCEPT: return "FTP_EVENT_ACCEPT";
+    case FTP_EVENT_OPEN_FAILED: return "FTP_EVENT_OPEN_FAILED";
+
+    case MANAGEMENT_EVENT: return "MANAGEMENT_EVENT";
+
+    case LOGIO_FINISHED: return "LOGIO_FINISHED";
+    case LOGIO_WRITE: return "LOGIO_WRITE";
+    case LOGIO_COUNTEDWRITE: return "LOGIO_COUNTEDWRITE";
+    case LOGIO_HAVENETIO: return "LOGIO_HAVENETIO";
+    case LOGIO_RECONFIG: return "LOGIO_RECONFIG";
+    case LOGIO_RECONFIG_FILE: return "LOGIO_RECONFIG_FILE";
+    case LOGIO_RECONFIG_FILEREAD: return "LOGIO_RECONFIG_FILEREAD";
+    case LOGIO_PULSE: return "LOGIO_PULSE";
+    case LOGIO_STARTUP: return "LOGIO_STARTUP";
+#endif
+
+    case MULTI_CACHE_EVENT_SYNC: return "MULTI_CACHE_EVENT_SYNC";
+
+    case CACHE_EVENT_LOOKUP: return "CACHE_EVENT_LOOKUP";
+    case CACHE_EVENT_LOOKUP_FAILED: return "CACHE_EVENT_LOOKUP_FAILED";
+    case CACHE_EVENT_OPEN_READ: return "CACHE_EVENT_OPEN_READ";
+    case CACHE_EVENT_OPEN_READ_FAILED: return "CACHE_EVENT_OPEN_READ_FAILED";
+    case CACHE_EVENT_OPEN_WRITE: return "CACHE_EVENT_OPEN_WRITE";
+    case CACHE_EVENT_OPEN_WRITE_FAILED: return "CACHE_EVENT_OPEN_WRITE_FAILED";
+    case CACHE_EVENT_REMOVE: return "CACHE_EVENT_REMOVE";
+    case CACHE_EVENT_REMOVE_FAILED: return "CACHE_EVENT_REMOVE_FAILED";
+    case CACHE_EVENT_UPDATE: return "CACHE_EVENT_UPDATE";
+    case CACHE_EVENT_UPDATE_FAILED: return "CACHE_EVENT_UPDATE_FAILED";
+    case CACHE_EVENT_LINK: return "CACHE_EVENT_LINK";
+    case CACHE_EVENT_LINK_FAILED: return "CACHE_EVENT_LINK_FAILED";
+    case CACHE_EVENT_DEREF: return "CACHE_EVENT_DEREF";
+    case CACHE_EVENT_DEREF_FAILED: return "CACHE_EVENT_DEREF_FAILED";
+    case CACHE_EVENT_RESPONSE: return "CACHE_EVENT_RESPONSE";
+    case CACHE_EVENT_RESPONSE_MSG: return "CACHE_EVENT_RESPONSE_MSG";
+
+#if 0
+    case CACHE_DB_EVENT_POOL_SYNC: return "CACHE_DB_EVENT_POOL_SYNC";
+    case CACHE_DB_EVENT_ITERATE_VECVEC: return "CACHE_DB_EVENT_ITERATE_VECVEC";
+    case CACHE_DB_EVENT_ITERATE_FRAG_HDR: return "CACHE_DB_EVENT_ITERATE_FRAG_HDR";
+    case CACHE_DB_EVENT_ITERATE_DONE: return "CACHE_DB_EVENT_ITERATE_DONE";
+
+    case HTTP_EVENT_CONNECTION_OPEN: return "HTTP_EVENT_CONNECTION_OPEN";
+    case HTTP_EVENT_CONNECTION_OPEN_ERROR: return "HTTP_EVENT_CONNECTION_OPEN_ERROR";
+    case HTTP_EVENT_READ_HEADER_COMPLETE: return "HTTP_EVENT_READ_HEADER_COMPLETE";
+    case HTTP_EVENT_READ_HEADER_ERROR: return "HTTP_EVENT_READ_HEADER_ERROR";
+    case HTTP_EVENT_READ_BODY_READY: return "HTTP_EVENT_READ_BODY_READY";
+    case HTTP_EVENT_READ_BODY_COMPLETE: return "HTTP_EVENT_READ_BODY_COMPLETE";
+    case HTTP_EVENT_WRITE_READY: return "HTTP_EVENT_WRITE_READY";
+    case HTTP_EVENT_WRITE_COMPLETE: return "HTTP_EVENT_WRITE_COMPLETE";
+    case HTTP_EVENT_EOS: return "HTTP_EVENT_EOS";
+    case HTTP_EVENT_CLOSED: return "HTTP_EVENT_CLOSED";
+
+    case NNTP_EVENT_CMD: return "NNTP_EVENT_CMD";
+    case NNTP_EVENT_CALL: return "NNTP_EVENT_CALL";
+    case NNTP_EVENT_CALL_DONE: return "NNTP_EVENT_CALL_DONE";
+    case NNTP_EVENT_ACQUIRE: return "NNTP_EVENT_ACQUIRE";
+    case NNTP_EVENT_ACQUIRE_FAILED: return "NNTP_EVENT_ACQUIRE_FAILED";
+    case NNTP_EVENT_SLAVE_RESPONSE: return "NNTP_EVENT_SLAVE_RESPONSE";
+    case NNTP_EVENT_SLAVE_INITIAL_ERROR: return "NNTP_EVENT_SLAVE_INITIAL_ERROR";
+    case NNTP_EVENT_SLAVE_ERROR: return "NNTP_EVENT_SLAVE_ERROR";
+    case NNTP_EVENT_SLAVE_DONE: return "NNTP_EVENT_SLAVE_DONE";
+    case NNTP_EVENT_TUNNEL_DONE: return "NNTP_EVENT_TUNNEL_DONE";
+    case NNTP_EVENT_TUNNEL_ERROR: return "NNTP_EVENT_TUNNEL_ERROR";
+    case NNTP_EVENT_TUNNEL_CONT: return "NNTP_EVENT_TUNNEL_CONT";
+    case NNTP_EVENT_CLUSTER_MSG: return "NNTP_EVENT_CLUSTER_MSG";
+#endif
+
+    case MGMT_EVENT_SHUTDOWN: return "MGMT_EVENT_SHUTDOWN";
+    case MGMT_EVENT_RESTART: return "MGMT_EVENT_RESTART";
+    case MGMT_EVENT_BOUNCE: return "MGMT_EVENT_BOUNCE";
+    case MGMT_EVENT_CONFIG_FILE_UPDATE: return "MGMT_EVENT_CONFIG_FILE_UPDATE";
+    case MGMT_EVENT_CLEAR_STATS: return "MGMT_EVENT_CLEAR_STATS";
 
   default:
     if (buffer != NULL) {

Modified: incubator/trafficserver/traffic/branches/dev/proxy/ICP.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/ICP.cc?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/ICP.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/ICP.cc Mon Feb  1 23:06:01 2010
@@ -450,7 +450,6 @@
         return EVENT_DONE;
       }
     case CACHE_EVENT_OPEN_READ_FAILED:
-    case CACHE_EVENT_OPEN_READ_FAILED_IN_PROGRESS:
       {
         event = CACHE_EVENT_LOOKUP_FAILED;
         break;

Modified: incubator/trafficserver/traffic/branches/dev/proxy/InkAPI.cc
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/InkAPI.cc?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/InkAPI.cc (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/InkAPI.cc Mon Feb  1 23:06:01 2010
@@ -7031,8 +7031,7 @@
   CacheInfo *info = (CacheInfo *) key;
   Continuation *i = (INKContInternal *) contp;
   return (INKAction)
-    cacheProcessor.open_write(i, 0, &info->cache_key,
-                              info->frag_type, false, info->pin_in_cache, info->hostname, info->len);
+    cacheProcessor.open_write(i, &info->cache_key, info->frag_type, 0, false, info->pin_in_cache, info->hostname, info->len);
 }
 
 INKAction
@@ -7983,8 +7982,8 @@
   CacheInfo *info = (CacheInfo *) key;
   Continuation *i = (INKContInternal *) contp;
   return (INKAction)
-    cacheProcessor.open_write(i, 0, &info->cache_key,
-                              info->frag_type, true, info->pin_in_cache, info->hostname, info->len);
+    cacheProcessor.open_write(i, &info->cache_key,
+                              info->frag_type, 0, true, info->pin_in_cache, info->hostname, info->len);
 }
 
 void

Modified: incubator/trafficserver/traffic/branches/dev/proxy/Makefile.am
URL: http://svn.apache.org/viewvc/incubator/trafficserver/traffic/branches/dev/proxy/Makefile.am?rev=905441&r1=905440&r2=905441&view=diff
==============================================================================
--- incubator/trafficserver/traffic/branches/dev/proxy/Makefile.am (original)
+++ incubator/trafficserver/traffic/branches/dev/proxy/Makefile.am Mon Feb  1 23:06:01 2010
@@ -184,6 +184,7 @@
   Prefetch.o \
   Update.o \
   TestHook.o \
+  RegressionSM.o \
   Plugin.o \
   PluginDB.o \
   InkAPI.o \
@@ -242,6 +243,7 @@
   Prefetch.o \
   Update.o \
   TestHook.o \
+  RegressionSM.o \
   Plugin.o \
   PluginDB.o \
   InkAPI.o \
@@ -301,6 +303,7 @@
   Prefetch.o \
   Update.o \
   TestHook.o \
+  RegressionSM.o \
   Plugin.o \
   PluginDB.o \
   InkAPI.o \



Mime
View raw message