You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucy.apache.org by ma...@apache.org on 2010/05/29 18:36:55 UTC

svn commit: r949415 - in /lucene/lucy/trunk/core/Lucy/Index: Snapshot.bp Snapshot.c

Author: marvin
Date: Sat May 29 16:36:55 2010
New Revision: 949415

URL: http://svn.apache.org/viewvc?rev=949415&view=rev
Log:
Rename Snapshot's "filename" to "path".  (filename_to_path.patch from
LUCY-103)

Modified:
    lucene/lucy/trunk/core/Lucy/Index/Snapshot.bp
    lucene/lucy/trunk/core/Lucy/Index/Snapshot.c

Modified: lucene/lucy/trunk/core/Lucy/Index/Snapshot.bp
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Index/Snapshot.bp?rev=949415&r1=949414&r2=949415&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Index/Snapshot.bp (original)
+++ lucene/lucy/trunk/core/Lucy/Index/Snapshot.bp Sat May 29 16:36:55 2010
@@ -2,9 +2,9 @@ parcel Lucy;
 
 /** Point-in-time index file list.
  *
- * A Snapshot is list of index files.  Because index files, once written, are
- * never modified, the list of files in a Snapshot defines a point-in-time
- * view of the data in an index.
+ * A Snapshot is list of index files and folders.  Because index files, once
+ * written, are never modified, a Snapshot defines a point-in-time view of the
+ * data in an index.
  *
  * IndexReader objects interpret the data associated with a single Snapshot.
  */
@@ -12,7 +12,7 @@ parcel Lucy;
 class Lucy::Index::Snapshot extends Lucy::Object::Obj : dumpable {
 
     Hash        *entries;
-    CharBuf     *filename;
+    CharBuf     *path;
 
     inert int32_t current_file_format;
 
@@ -50,13 +50,13 @@ class Lucy::Index::Snapshot extends Lucy
     Delete_Entry(Snapshot *self, const CharBuf *entry);
 
     void
-    Set_Filename(Snapshot *self, const CharBuf *filename);
+    Set_Path(Snapshot *self, const CharBuf *path);
 
-    /** The name of the file that the Snapshot serves as a proxy for.
-     * Initially NULL; updated by Read_File() and Write_File().
+    /** The path to the file that the Snapshot serves as a proxy for.
+     * Initially NULL; updated by Read_File(), Write_File(), and Set_Path().
      */
     public nullable CharBuf*
-    Get_Filename(Snapshot *self);
+    Get_Path(Snapshot *self);
 
     public void 
     Destroy(Snapshot *self);

Modified: lucene/lucy/trunk/core/Lucy/Index/Snapshot.c
URL: http://svn.apache.org/viewvc/lucene/lucy/trunk/core/Lucy/Index/Snapshot.c?rev=949415&r1=949414&r2=949415&view=diff
==============================================================================
--- lucene/lucy/trunk/core/Lucy/Index/Snapshot.c (original)
+++ lucene/lucy/trunk/core/Lucy/Index/Snapshot.c Sat May 29 16:36:55 2010
@@ -2,9 +2,12 @@
 #include "Lucy/Util/ToolSet.h"
 
 #include "Lucy/Index/Snapshot.h"
+#include "Lucy/Store/Folder.h"
 #include "Lucy/Util/StringHelper.h"
+#include "Lucy/Util/IndexFileNames.h"
+#include "Lucy/Util/Json.h"
 
-int32_t Snapshot_current_file_format = 1;
+int32_t Snapshot_current_file_format = 2;
 
 Snapshot*
 Snapshot_new()
@@ -17,9 +20,9 @@ static void
 S_zero_out(Snapshot *self)
 {
     DECREF(self->entries);
-    DECREF(self->filename);
+    DECREF(self->path);
     self->entries  = Hash_new(0);
-    self->filename = NULL;
+    self->path = NULL;
 }
 
 Snapshot*
@@ -33,14 +36,14 @@ void
 Snapshot_destroy(Snapshot *self)
 {
     DECREF(self->entries);
-    DECREF(self->filename);
+    DECREF(self->path);
     SUPER_DESTROY(self, SNAPSHOT);
 }
 
 void
-Snapshot_add_entry(Snapshot *self, const CharBuf *filename)
+Snapshot_add_entry(Snapshot *self, const CharBuf *entry)
 {
-    Hash_Store(self->entries, (Obj*)filename, INCREF(&EMPTY));
+    Hash_Store(self->entries, (Obj*)entry, INCREF(&EMPTY));
 }
 
 bool_t
@@ -65,14 +68,14 @@ uint32_t
 Snapshot_num_entries(Snapshot *self) { return Hash_Get_Size(self->entries); }
 
 void
-Snapshot_set_filename(Snapshot *self, const CharBuf *filename)
+Snapshot_set_path(Snapshot *self, const CharBuf *path)
 {
-    DECREF(self->filename);
-    self->filename = filename ? CB_Clone(filename) : NULL;
+    DECREF(self->path);
+    self->path = path ? CB_Clone(path) : NULL;
 }
 
 CharBuf*
-Snapshot_get_filename(Snapshot *self) { return self->filename; }
+Snapshot_get_path(Snapshot *self) { return self->path; }
 
 /* Copyright 2009 The Apache Software Foundation
  *