Package org.apache.cassandra.io

Examples of org.apache.cassandra.io.FSWriteError


        {
            return File.createTempFile(prefix, suffix, directory);
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, directory);
        }
    }
View Full Code Here


        {
            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

        {
            out.getFD().sync();
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, getPath());
        }
    }
View Full Code Here

        {
            out.write(buffer, 0, validBufferBytes);
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, getPath());
        }

        if (metadata != null)
            metadata.append(buffer, 0, validBufferBytes);
    }
View Full Code Here

        {
            out.getChannel().truncate(toSize);
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, getPath());
        }
    }
View Full Code Here

        {
            out.close();
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, getPath());
        }

        FileUtils.closeQuietly(metadata);
        CLibrary.tryCloseFD(directoryFD);
    }
View Full Code Here

            // write corresponding checksum
            out.writeInt((int) checksum.getValue());
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, getPath());
        }

        // reset checksum object to the blank state for re-use
        checksum.reset();
View Full Code Here

        {
            metadataWriter.close();
        }
        catch (IOException e)
        {
            throw new FSWriteError(e, getPath());
        }
    }
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.