Package net.timewalker.ffmq3.storage.data

Examples of net.timewalker.ffmq3.storage.data.DataStoreException


          dataRandomAccessFile.seek((long)blockHandle*blockSize);
          dataRandomAccessFile.write(data,offset,len);
        }
      catch (IOException e)
      {
        throw new DataStoreException("Cannot write data block "+blockHandle+" : "+dataFile.getAbsolutePath(),e);
      }
    }
View Full Code Here


    {
    try
    {
          dataRandomAccessFile.seek((long)blockHandle*blockSize);
          if (dataRandomAccessFile.read(data,offset,len) != len)
              throw new DataStoreException("Cannot read "+len+" bytes from store file");
    }
    catch (DataStoreException e)
    {
        throw e;
    }
        catch (IOException e)
        {
            throw new DataStoreException("Could not read data block "+blockHandle+" : "+dataFile.getAbsolutePath(),e);
        }
    }
View Full Code Here

            // Update data file
            dataRandomAccessFile.setLength((long)blockSize*newBlockCount);
        }
        catch (IOException e)
        {
            throw new DataStoreException("Could not extends store to "+newBlockCount+" blocks : "+dataFile.getAbsolutePath(),e);
        }
    }
View Full Code Here

        if (!keepJournalFiles)
        {
          for (int i = 0; i < journalFiles.length; i++)
        {
            if (!journalFiles[i].delete())
              throw new DataStoreException("Cannot delete journal file : "+journalFiles[i].getAbsolutePath());
        }
        }
       
        // Integrity check
        log.warn("["+baseName+"] Forcing integrity check after journal recovery ...");
View Full Code Here

          // Make sure we do not conflict with an async write from journal
          synchronized (dataRandomAccessFile)
        {
              dataRandomAccessFile.seek((long)blockHandle*blockSize);
              if (dataRandomAccessFile.read(data,offset,len) != len)
                  throw new DataStoreException("Cannot read "+len+" bytes from store file");
        }
        }
        catch (DataStoreException e)
        {
            throw e;
        }
            catch (IOException e)
            {
                throw new DataStoreException("Could not read data block "+blockHandle,e);
            }
      }
    }
View Full Code Here

        journal.commit(barrier);
        barrier.waitFor();
      }
      catch (InterruptedException e)
      {
        throw new DataStoreException("Wait for commit barrier was interrupted");
      }
    }
View Full Code Here

                               int blockCount ,
                               int blockSize ,
                               boolean forceSync ) throws DataStoreException
    {
        if (blockCount <= 0)
            throw new DataStoreException("Block count should be > 0");
        if (blockSize <= 0)
            throw new DataStoreException("Block size should be > 0");
       
        File atFile = new File(dataFolder,baseName+AbstractBlockBasedDataStore.ALLOCATION_TABLE_SUFFIX);
        File dataFile = new File(dataFolder,baseName+AbstractBlockBasedDataStore.DATA_FILE_SUFFIX);
        if (atFile.exists())
            throw new DataStoreException("Cannot create store filesystem : "+atFile.getAbsolutePath()+" already exists");
        if (dataFile.exists())
            throw new DataStoreException("Cannot create store filesystem : "+dataFile.getAbsolutePath()+" already exists");
       
        initAllocationTable(atFile,
                            blockCount,
                            blockSize,
                            forceSync);
View Full Code Here

            out.close();
        }
        catch (IOException e)
        {
            throw new DataStoreException("Cannot initialize allocation table " + atFile.getAbsolutePath(),e);
        }
    }
View Full Code Here

                dataFileMap.getFD().sync();
            dataFileMap.close();
        }
        catch (IOException e)
        {
            throw new DataStoreException("Cannot initialize map file " + dataFile.getAbsolutePath(),e);
        }
    }
View Full Code Here

        if (force)
          {
          for (int i = 0; i < journalFiles.length; i++)
          {
                if (!journalFiles[i].delete())
                    throw new DataStoreException("Cannot delete file : "+journalFiles[i].getAbsolutePath());
         
          }
        else
          throw new DataStoreException("Journal file exist : "+journalFiles[0].getAbsolutePath());
      }
           
     
        File atFile = new File(dataFolder,baseName+AbstractBlockBasedDataStore.ALLOCATION_TABLE_SUFFIX);
        if (atFile.exists())
            if (!atFile.delete())
              throw new DataStoreException("Cannot delete file : "+atFile.getAbsolutePath());

        File dataFile = new File(dataFolder,baseName+AbstractBlockBasedDataStore.DATA_FILE_SUFFIX);
        if (dataFile.exists())
            if (!dataFile.delete())
              throw new DataStoreException("Cannot delete file : "+dataFile.getAbsolutePath());
    }
View Full Code Here

TOP

Related Classes of net.timewalker.ffmq3.storage.data.DataStoreException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.