Commit 1afb6a33 authored by Antony Chazapis's avatar Antony Chazapis

Update documentation.

parent b3f494de
......@@ -17,7 +17,9 @@ Then find the plain text version of the docs in docs/build/text.
Running the server
------------------
Enter the pithos dir and run:
Enter the pithos dir, copy settings.py.dist to settings.py and change the SECRET_KEY inside.
Then run:
python manage.py syncdb
python manage.py loaddata aai/fixtures/auth_test_data.json (to load sample users)
python manage.py runserver
......
......@@ -16,7 +16,7 @@ Get the source::
cd /
git clone https://code.grnet.gr/git/pithos
Setup the files (choose where to store data in ``settings.py``)::
Setup the files (choose where to store data in ``settings.py`` and change ``SECRET_KEY``)::
cd /pithos/pithos
cp settings.py.dist settings.py
......
......@@ -2,7 +2,57 @@ Backends
========
.. toctree::
:maxdepth: 1
:maxdepth: 3
base_backend
simple_backend
BaseBackend
-----------
.. autoclass:: pithos.backends.base.BaseBackend
SimpleBackend
-------------
.. autoclass:: pithos.backends.simple.SimpleBackend
:show-inheritance:
:members:
:inherited-members:
ModularBackend
--------------
.. autoclass:: pithos.backends.modular.ModularBackend
:show-inheritance:
:members:
:inherited-members:
Node
~~~~
.. automodule:: pithos.backends.lib.node
:show-inheritance:
:members:
:undoc-members:
Policy
~~~~~~
.. automodule:: pithos.backends.lib.policy
:show-inheritance:
:members:
:undoc-members:
Permissions
~~~~~~~~~~~
.. automodule:: pithos.backends.lib.permissions
:show-inheritance:
:members:
:undoc-members:
Hashfiler
~~~~~~~~~
.. automodule:: pithos.backends.lib.hashfiler
:show-inheritance:
:members:
:undoc-members:
BaseBackend
===========
.. automodule:: pithos.backends.base
Client Library
==============
.. automodule:: pithos.lib.client
Client Library
==============
.. automodule:: tools.lib.client
:show-inheritance:
:members:
:undoc-members:
Clients
========
.. toctree::
:maxdepth: 1
client-lib
\ No newline at end of file
......@@ -4,12 +4,12 @@ Pithos Documentation
Contents:
.. toctree::
:maxdepth: 2
:maxdepth: 3
devguide
adminguide
backends
clients
clientlib
Indices and tables
==================
......
SimpleBackend
=============
.. automodule:: pithos.backends.simple
This diff is collapsed.
......@@ -34,3 +34,5 @@
from blocker import Blocker
from mapper import Mapper
__all__ = ["Blocker", "Mapper"]
......@@ -74,7 +74,7 @@ class Blocker(object):
self.hashlen = len(emptyhash)
self.emptyhash = emptyhash
def get_rear_block(self, blkhash, create=0):
def _get_rear_block(self, blkhash, create=0):
filename = hexlify(blkhash)
dir = join(self.blockpath, filename[0:2], filename[2:4], filename[4:6])
if not exists(dir):
......@@ -82,7 +82,7 @@ class Blocker(object):
name = join(dir, filename)
return ContextFile(name, create)
def check_rear_block(self, blkhash):
def _check_rear_block(self, blkhash):
filename = hexlify(blkhash)
dir = join(self.blockpath, filename[0:2], filename[2:4], filename[4:6])
name = join(dir, filename)
......@@ -101,7 +101,7 @@ class Blocker(object):
missing = []
append = missing.append
for i, h in enumerate(hashes):
if not self.check_rear_block(h):
if not self._check_rear_block(h):
append(i)
return missing
......@@ -113,7 +113,7 @@ class Blocker(object):
block = None
for h in hashes:
with self.get_rear_block(h, 0) as rbl:
with self._get_rear_block(h, 0) as rbl:
if not rbl:
break
for block in rbl.sync_read_chunks(blocksize, 1, 0):
......@@ -135,7 +135,7 @@ class Blocker(object):
mf = None
missing = self.block_ping(hashlist)
for i in missing:
with self.get_rear_block(hashlist[i], 1) as rbl:
with self._get_rear_block(hashlist[i], 1) as rbl:
rbl.sync_write(blocklist[i]) #XXX: verify?
return hashlist, missing
......
......@@ -57,11 +57,11 @@ class Mapper(object):
raise ValueError("Variable mappath '%s' is not a directory" % (mappath,))
self.mappath = mappath
def get_rear_map(self, name, create=0):
def _get_rear_map(self, name, create=0):
name = join(self.mappath, hex(int(name)))
return ContextFile(name, create)
def delete_rear_map(self, name):
def _delete_rear_map(self, name):
name = join(self.mappath, hex(int(name)))
try:
unlink(name)
......@@ -79,7 +79,7 @@ class Mapper(object):
namelen = self.namelen
hashes = ()
with self.get_rear_map(name, 0) as rmap:
with self._get_rear_map(name, 0) as rmap:
if rmap:
hashes = list(rmap.sync_read_chunks(namelen, nr, blkoff))
return hashes
......@@ -87,16 +87,16 @@ class Mapper(object):
def map_stor(self, name, hashes=(), blkoff=0, create=1):
"""Store hashes in the given hashes map, replacing the old ones."""
namelen = self.namelen
with self.get_rear_map(name, 1) as rmap:
with self._get_rear_map(name, 1) as rmap:
rmap.sync_write_chunks(namelen, blkoff, hashes, None)
# def map_copy(self, src, dst):
# """Copy a hashes map to another one, replacing it."""
# with self.get_rear_map(src, 0) as rmap:
# with self._get_rear_map(src, 0) as rmap:
# if rmap:
# rmap.copy_to(dst)
def map_remv(self, name):
"""Remove a hashes map. Returns true if the map was found and removed."""
return self.delete_rear_map(name)
return self._delete_rear_map(name)
......@@ -609,7 +609,7 @@ class SimpleBackend(BaseBackend):
@backend_method(autocommit=0)
def put_block(self, data):
"""Create a block and return the hash."""
"""Store a block and return the hash."""
logger.debug("put_block: %s", len(data))
hashes, absent = self.blocker.block_stor((data,))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment