Package org.apache.cassandra.io

Examples of org.apache.cassandra.io.FSWriteError


        {
            Files.delete(file.toPath());
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, file);
        }
    }
View Full Code Here


        {
            file.getChannel().truncate(size);
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, path);
        }
        finally
        {
            closeQuietly(file);
        }
View Full Code Here

    public static void createDirectory(File directory)
    {
        if (!directory.exists())
        {
            if (!directory.mkdirs())
                throw new FSWriteError(new IOException("Failed to mkdirs " + directory), directory);
        }
    }
View Full Code Here

            if (!dir.isDirectory())
                throw new AssertionError(String.format("Invalid directory path %s: path exists but is not a directory", dir));
        }
        else if (!dir.mkdirs() && !(dir.exists() && dir.isDirectory()))
        {
            throw new FSWriteError(new IOException("Unable to create directory " + dir), dir);
        }
        return dir;
    }
View Full Code Here

                    {
                        cacheLoader.serialize(key, writer.stream);
                    }
                    catch (IOException e)
                    {
                        throw new FSWriteError(e, writer.getPath());
                    }

                    keysWritten++;
                }
            }
View Full Code Here

            os = new BufferedOutputStream(new FileOutputStream(file, true));
            os.write(toString().getBytes());
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, file);
        }
        finally
        {
            FileUtils.closeQuietly(os);
        }
View Full Code Here

            needsSync = true;
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, logFile);
        }
    }
View Full Code Here

            {
                buffer.force();
            }
            catch (Exception e) // MappedByteBuffer.force() does not declare IOException but can actually throw it
            {
                throw new FSWriteError(e, getPath());
            }
            needsSync = false;
        }
    }
View Full Code Here

            logFileAccessor.close();
            closed = true;
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, getPath());
        }
    }
View Full Code Here

            g.writeEndObject(); // write global object
            g.close();
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, tmpFile);
        }

        if (oldFile.exists() && manifestFile.exists())
            FileUtils.deleteWithConfirm(oldFile);
View Full Code Here

TOP

Related Classes of org.apache.cassandra.io.FSWriteError

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.