Package org.apache.cassandra.db.compaction

Examples of org.apache.cassandra.db.compaction.Scrubber$ScrubController


            {
                for (SSTableReader sstable : sstables)
                {
                    try
                    {
                        Scrubber scrubber = new Scrubber(cfs, sstable, handler, true);
                        try
                        {
                            scrubber.scrub();
                        }
                        finally
                        {
                            scrubber.close();
                        }

                        if (manifest != null)
                        {
                            if (scrubber.getNewInOrderSSTable() != null)
                                manifest.add(scrubber.getNewInOrderSSTable());

                            List<SSTableReader> added = scrubber.getNewSSTable() == null
                                ? Collections.<SSTableReader>emptyList()
                                : Collections.<SSTableReader>singletonList(scrubber.getNewSSTable());
                            manifest.replace(Collections.singletonList(sstable), added);
                        }

                        // Remove the sstable (it's been copied by scrub and snapshotted)
                        sstable.markCompacted();
View Full Code Here


            {
                for (SSTableReader sstable : sstables)
                {
                    try
                    {
                        Scrubber scrubber = new Scrubber(cfs, sstable, handler, true);
                        try
                        {
                            scrubber.scrub();
                        }
                        finally
                        {
                            scrubber.close();
                        }

                        if (manifest != null)
                        {
                            if (scrubber.getNewInOrderSSTable() != null)
                                manifest.add(scrubber.getNewInOrderSSTable());

                            List<SSTableReader> added = scrubber.getNewSSTable() == null
                                ? Collections.<SSTableReader>emptyList()
                                : Collections.<SSTableReader>singletonList(scrubber.getNewSSTable());
                            manifest.replace(Collections.singletonList(sstable), added);
                        }

                        // Remove the sstable (it's been copied by scrub and snapshotted)
                        sstable.markCompacted();
View Full Code Here

            {
                for (SSTableReader sstable : sstables)
                {
                    try
                    {
                        Scrubber scrubber = new Scrubber(cfs, sstable, handler, true);
                        try
                        {
                            scrubber.scrub();
                        }
                        finally
                        {
                            scrubber.close();
                        }

                        if (manifest != null)
                        {
                            if (scrubber.getNewInOrderSSTable() != null)
                                manifest.add(scrubber.getNewInOrderSSTable());

                            List<SSTableReader> added = scrubber.getNewSSTable() == null
                                ? Collections.<SSTableReader>emptyList()
                                : Collections.singletonList(scrubber.getNewSSTable());
                            manifest.replace(Collections.singletonList(sstable), added);
                        }

                        // Remove the sstable (it's been copied by scrub and snapshotted)
                        sstable.markCompacted();
View Full Code Here

            {
                for (SSTableReader sstable : sstables)
                {
                    try
                    {
                        Scrubber scrubber = new Scrubber(cfs, sstable, handler, true);
                        try
                        {
                            scrubber.scrub();
                        }
                        finally
                        {
                            scrubber.close();
                        }

                        if (manifest != null)
                        {
                            if (scrubber.getNewInOrderSSTable() != null)
                                manifest.add(scrubber.getNewInOrderSSTable());

                            List<SSTableReader> added = scrubber.getNewSSTable() == null
                                ? Collections.<SSTableReader>emptyList()
                                : Collections.singletonList(scrubber.getNewSSTable());
                            manifest.replace(Collections.singletonList(sstable), added);
                        }

                        // Remove the sstable (it's been copied by scrub and snapshotted)
                        sstable.markCompacted();
View Full Code Here

            {
                for (SSTableReader sstable : sstables)
                {
                    try
                    {
                        Scrubber scrubber = new Scrubber(cfs, sstable, handler, true);
                        try
                        {
                            scrubber.scrub();
                        }
                        finally
                        {
                            scrubber.close();
                        }

                        if (manifest != null)
                        {
                            if (scrubber.getNewInOrderSSTable() != null)
                                manifest.add(scrubber.getNewInOrderSSTable());

                            List<SSTableReader> added = scrubber.getNewSSTable() == null
                                ? Collections.<SSTableReader>emptyList()
                                : Collections.singletonList(scrubber.getNewSSTable());
                            manifest.replace(Collections.singletonList(sstable), added);
                        }

                        // Remove the sstable (it's been copied by scrub and snapshotted)
                        sstable.markObsolete();
View Full Code Here

        components.add(Component.STATS);
        components.add(Component.SUMMARY);
        components.add(Component.TOC);
        SSTableReader sstable = SSTableReader.openNoValidation(desc, components, metadata);

        Scrubber scrubber = new Scrubber(cfs, sstable);
        scrubber.scrub();

        cfs.loadNewSSTables();
        List<Row> rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
        assert isRowOrdered(rows) : "Scrub failed: " + rows;
        assert rows.size() == 6 : "Got " + rows.size();
View Full Code Here

            {
                for (SSTableReader sstable : sstables)
                {
                    try
                    {
                        Scrubber scrubber = new Scrubber(cfs, sstable, options.skipCorrupted, handler, true);
                        try
                        {
                            scrubber.scrub();
                        }
                        finally
                        {
                            scrubber.close();
                        }

                        if (manifest != null)
                        {
                            if (scrubber.getNewInOrderSSTable() != null)
                                manifest.add(scrubber.getNewInOrderSSTable());

                            List<SSTableReader> added = scrubber.getNewSSTable() == null
                                ? Collections.<SSTableReader>emptyList()
                                : Collections.singletonList(scrubber.getNewSSTable());
                            manifest.replace(Collections.singletonList(sstable), added);
                        }

                        // Remove the sstable (it's been copied by scrub and snapshotted)
                        sstable.markObsolete();
View Full Code Here

        file.seek(startPosition);
        file.writeBytes(StringUtils.repeat('z', (int) (endPosition - startPosition)));
        file.close();

        // with skipCorrupted == false, the scrub is expected to fail
        Scrubber scrubber = new Scrubber(cfs, sstable, false);
        try
        {
            scrubber.scrub();
            fail("Expected a CorruptSSTableException to be thrown");
        }
        catch (IOError err) {}

        // with skipCorrupted == true, the corrupt row will be skipped
        scrubber = new Scrubber(cfs, sstable, true);
        scrubber.scrub();
        scrubber.close();
        cfs.replaceCompactedSSTables(Collections.singletonList(sstable), Collections.singletonList(scrubber.getNewSSTable()), OperationType.SCRUB);
        assertEquals(1, cfs.getSSTables().size());

        // verify that we can read all of the rows, and there is now one less row
        rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
        assertEquals(1, rows.size());
View Full Code Here

        components.add(Component.STATS);
        components.add(Component.SUMMARY);
        components.add(Component.TOC);
        SSTableReader sstable = SSTableReader.openNoValidation(desc, components, metadata);

        Scrubber scrubber = new Scrubber(cfs, sstable, false);
        scrubber.scrub();

        cfs.loadNewSSTables();
        List<Row> rows = cfs.getRangeSlice(Util.range("", ""), null, new IdentityQueryFilter(), 1000);
        assert isRowOrdered(rows) : "Scrub failed: " + rows;
        assert rows.size() == 6 : "Got " + rows.size();
View Full Code Here

            {
                for (SSTableReader sstable : sstables)
                {
                    try
                    {
                        Scrubber scrubber = new Scrubber(cfs, sstable, handler, true);
                        try
                        {
                            scrubber.scrub();
                        }
                        finally
                        {
                            scrubber.close();
                        }

                        if (manifest != null)
                        {
                            if (scrubber.getNewInOrderSSTable() != null)
                                manifest.add(scrubber.getNewInOrderSSTable());

                            List<SSTableReader> added = scrubber.getNewSSTable() == null
                                ? Collections.<SSTableReader>emptyList()
                                : Collections.singletonList(scrubber.getNewSSTable());
                            manifest.replace(Collections.singletonList(sstable), added);
                        }

                        // Remove the sstable (it's been copied by scrub and snapshotted)
                        sstable.markCompacted();
View Full Code Here

TOP

Related Classes of org.apache.cassandra.db.compaction.Scrubber$ScrubController

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.