-
Notifications
You must be signed in to change notification settings - Fork 66
Fix MLCP call to add database if ml-version=8 #396
Comments
Not trivial, depends on MLCP version as well. Postponing issue.. |
mlcp does not seem to provide a way to get its version from command line... 2 possibles approach:
require 'zip'
def mlcp_version()
pom = 'META-INF/maven/com.marklogic/mlcp-Hadoop2/pom.properties'
Zip::File.open "C:/dev/mlcp/lib/mlcp-Hadoop2-1.3-2.jar" do |zip_file|
entry = zip_file.glob(pom).first
properties = entry.get_input_stream.read
properties = /(version=(.*)\n)/.match(properties)
print properties[2]
end
end
def mlcp_import_help()
import_help = %x[mlcp IMPORT HELP]
print import_help
found = import_help.to_s =~ (/(.*)(-database)(.*)/)
print "found - #{found}"
print "\n"
end
start = Time.now
# mlcp_import_help()
mlcp_version()
time = Time.now - start
print "Elapsed time #{time}" |
I filed an rfe to ask for printing version from command-line.. Maybe we can also take version from the physical path of mlcp? For time being we could use a property to toggle as well mlcp-db-option=true |
Somewhere in the past year a version command was added. It requires string parsing to get out unfortunately, but should be doable.. |
The version command has been added, but requires string parsing too, and probably takes noticeable overhead too. I'm wondering though about the use case. I see no particular need to run MLCP against any other db than the content-db. Except maybe to bypass app-level auth issues, and run MLCP against 8000 instead? But that would complicate using MLCP transformations. Anyone else can think of a good reason to want this? Keep in mind an end user can always add a database options him/herself.. |
I'd consider closing this, if we can't think of a good use case.. |
Glancing at #373 I think we came up with this because we wanted to run MLCP against 8000, but MLCP should work happily against app-port in most cases. And in the few cases it doesn't, one can revert to xcc-port instead.. |
Final verdict, just use xcc-port if running against app-port doesn't work. Running MLCP against 8000 would prevent the ability to use transforms, so I think running against xcc-port would be better. |
No description provided.
The text was updated successfully, but these errors were encountered: