A Pen by Bhavani Ikkurthi on CodePen.
This file has been truncated, but you can view the full file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en" > | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>CodePen - Resources Filters</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"><link rel='stylesheet' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css'> | |
| <link rel='stylesheet' href='https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.5.1/animate.min.css'><link rel="stylesheet" href="./style.css"> | |
| </head> | |
| <body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Adaptation of @stillalex's script from here https://gist.github.com/stillalex/06303f8cc1d3780d3eab4c72575883ae | |
| //This version works with Oak 1.6 and later versions | |
| import java.io.InputStream; | |
| import java.util.concurrent.atomic.AtomicInteger | |
| import org.apache.jackrabbit.oak.api.Type | |
| import org.apache.jackrabbit.oak.spi.state.NodeState | |
| import org.apache.jackrabbit.oak.spi.state.NodeStore | |
| def countNodes(NodeState n, deep = false, String path = "/", Integer flush = 100000, AtomicInteger count = new AtomicInteger(0), AtomicInteger binaries = new AtomicInteger(0), root = true) { | |
| if(root) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.InputStream; | |
| import java.util.concurrent.atomic.AtomicInteger | |
| import org.apache.jackrabbit.oak.api.Type | |
| import org.apache.jackrabbit.oak.plugins.segment.SegmentBlob | |
| import org.apache.jackrabbit.oak.spi.state.NodeState | |
| import org.apache.jackrabbit.oak.spi.commit.CommitInfo | |
| import org.apache.jackrabbit.oak.spi.commit.EmptyHook | |
| import org.apache.jackrabbit.oak.spi.state.NodeStore | |
| import org.apache.jackrabbit.oak.commons.PathUtils | |
| import org.apache.jackrabbit.oak.console.ConsoleSession |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import org.apache.jackrabbit.oak.spi.commit.CommitInfo | |
| import org.apache.jackrabbit.oak.spi.commit.EmptyHook | |
| import org.apache.jackrabbit.oak.spi.state.NodeStore | |
| import org.apache.jackrabbit.oak.commons.PathUtils | |
| def rmNode(def session, String path) { | |
| println "Removing node ${path}" | |
| NodeStore ns = session.store | |
| def nb = ns.root.builder() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.io.InputStream; | |
| import java.util.concurrent.atomic.AtomicInteger | |
| import org.apache.jackrabbit.oak.api.Type | |
| import org.apache.jackrabbit.oak.plugins.segment.SegmentBlob | |
| import org.apache.jackrabbit.oak.spi.state.NodeState | |
| def countNodes(NodeState n, deep = false, String path = "/", Integer flush = 50000, AtomicInteger count = new AtomicInteger(0), AtomicInteger binaries = new AtomicInteger(0), root = true) { | |
| if(root) { | |
| println "Counting nodes in tree ${path}" | |
| } |