JCR Modeshape - How is the repository storage structure in hard? - jcr

I have some node and a folder node contain file nodes in my repository. My repository directory path is:
\home\myStorage\myRepository.
When I browse the repository directory, it contains some unknown files like this name: "-5597184", and some folders like these names: 0d , 0b , .... That I think these are my folder nodes. But sometimes these folders created out of myRepository directory! I don't know why!? but there is no problem in my application.
1. I just want to know why this happens? While the path for adding node is correct!
And the folders that I think are my node folders are too nested! I mean they are folder in folder in folder , like this path: /0b/95/46/fileName.pdf.
2. Why are they so?
Thank in advance.

I presume you're using ModeShape 3.x. In that case, you've likely configured the repository to store the binary content in that directory.
In that case, ModeShape stores binary values keyed by the SHA-1 hash of the bytes, in a directory structured defined by various parts of the SHA-1 hash (which is nicely distributed). For details, see our documentation.
BTW, that is just the binary value storage. Your indexes and Infinispan storage should be elsewhere; if not, your configuration needs to be corrected. If you have any questions, ask them on our user forums.

Related

puppet 3 add manifest directory in config instead file

I'm stuck and can't find any answer in google.
At now my master config point to single manifest
manifest = $confdir/manifests/cronjob.pp
Question is how can i change point to directory instead to use all of the files(manifests) from this folder.
It's pretty annoying change point every time then you created new manifest.
I'm using puppet 3.24(and i now it's veeery old)
Your answer can be found by searching the Puppet Configuration Reference
Excerpt follows:
The entry-point manifest for puppet master. This can be one file or a directory of manifests to be evaluated in alphabetical order. Puppet manages this path as a directory if one exists or if the path ends with a / or .
This being said, if you set your manifest to the following:
manifest = $confdir/manifests/
It should read each manifest in the directory in alphabetical order.

Relatively where does solr.data.dir in solrconfig.xml points to?

In all configuration below, a prefix of "solr." for class names
is an alias that causes solr to search appropriate packages,
including org.apache.solr.(search|update|request|core|analysis)
You may also specify a fully qualified Java classname if you
have your own custom plugins.
This is what I found while going through the solrconfig.xml file. But it seems this is defined to point to the respective classes in solr. I know somehow SOLR_HOME is used for solr.data.dir. I have used solr using "start.jar" and also using "solr-**-*.war" on Tomcat. It just works !!! :)
So where does solr.data.dir points to ?
Where exactly is SOLR_HOME is defined ?
So where does solr.data.dir points to?
The dataDir parameter is used to specify the directory for storing all index data. If this directory is not absolute, then it is relative to the directory where you started Solr. If the folder is empty, the new index would be re-created automatically when starting Solr.
Where exactly is SOLR_HOME is defined?
It really depends on operating system and web server used. And it defines the home directory of your Solr.
The most commonly it could be defined either:
in startup files,
using system environment variables, e.g.:
export JAVA_OPTS="$JAVA_OPTS -Dsolr.solr.home=/opt/solr/example"
during runtime as part of JAVA_OPTS (on Debian, in /etc/default/tomcat7 for instance, format: -Dmy.prop=value),
using System property substitution file (core.properties/solrcore.properties),
using Tomcat Context Configuration (e.g. in conf/Catalina/localhost by solr/home),
per Solr instance in solr.xml (instanceDir).
Best is to specify it explicitly.
You can modify tomcat/bin/catalina.sh to add following JVM option:
-Dsolr.solr.home=/home/mdhussain/solr-test/deployment/solr1
Data directory is relative to solr home, you can override this in solrconfig.xml.
If you are running on a MAC it's default installation directory (including data)
- if installed via maven dependency at least - is in the /var/XXX directory.
cd /var
grep --color -iHrn solr .
Example on my machine for the index data location:
/var/folders/1j/z7f1373977s_qlfvv9t71kmh0000gq/T/solr-7.3.1/solr-7.3.1/server/solr/cores/catalog_reindex/data

How to hash the (possibly recursive) contents of a directory

What I'm trying to do is know what particular subdirectories have changed after pulling from a git repository. I was thinking I could compute the hash of all the subdirectories in the root directory, then pull git, then compute the hashes again. If the hashes don't match, then I know which directories have changed.
Is there a common way to compute the hash of a directory tree? I feel like this is pretty much what git does internally to track its files.
I would prefer a C, or better yet, objective-c api to do this, but i'd settle for a unix command to do it.
thanks for any tips.
Computing a hash of a directory hierarchy is expensive, especially in a large git repository.
You should look at the API provided by git. There may be a way to ask git to tell you what it is changing.
You should look at OS X's file system events API. This can send your app a notification when something in a directory hierarchy changes.
https://developer.apple.com/library/mac/documentation/Darwin/Conceptual/FSEvents_ProgGuide/Introduction/Introduction.html

How can I write into a file within an Eclipse bundle?

I have an xml configuration file located into my plugin resources. I want to update this file whenever in the plugin happens some event. I found some methods to find and read the contents of a file located my plugin classpath, but I'm looking for a way to write into such a file.
Is there any way?
Many thanks.
That location (the install directory) is intended to be read-only since it may be shared in a network install scenario. I suggest you instead write the XML file to your plugin's state location which is intended for just this purpose:
String path = Activator.getDefault().getStateLocation().toString();
I should add that this gives you a fully qualified path to the directory created by Eclipse for any files your plugin wants to store. This directory is unique to your plugin.

Two /gen folders on Linux?

I am using IDEA 11.1 on Ubuntu 11.10 system. I renamed the main module via Ctrl+F6 and after this IDEA created two /gen folders. Look at the image
The upper /gen has full path in the brackets (like /disk2/work/project/...). The lower /gen contains the path via desktop shortcut (like /home/user/Desktop/work/project/...). The both paths leads to the same directory.
The top-most folder has new name, while the lower folder (under the upper gen directory) has the name of a hard disk directory of a project.
Can anyone suggest how to merge this? It's making me a headache as IDEA does not recognize any new resource I add to this project.
I tried deleting all .idea and other conf files and recreating a project into the same directory (via Create Project with existing source files command), but it did not solve the issue.
I also tried to reverse to the previous state via "Show History" feature, but it was not possible. This step was not in the history.
PS. sorry about black-line parts but I was instructed to do so.