Skip to content
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.

Fix MLCP call to add database if ml-version=8 #396

Closed
grtjn opened this issue Feb 24, 2015 · 8 comments
Closed

Fix MLCP call to add database if ml-version=8 #396

grtjn opened this issue Feb 24, 2015 · 8 comments
Assignees
Milestone

Comments

@grtjn
Copy link
Contributor

grtjn commented Feb 24, 2015

No description provided.

@grtjn grtjn modified the milestone: 1.7.2 Feb 25, 2015
@grtjn
Copy link
Contributor Author

grtjn commented Apr 30, 2015

Not trivial, depends on MLCP version as well. Postponing issue..

@grtjn grtjn removed this from the 1.7.2 milestone Apr 30, 2015
@rlouapre
Copy link
Contributor

mlcp does not seem to provide a way to get its version from command line...

2 possibles approach:

  • Get the version from pom.properties
  • Use mlcp HELP command (this option can very slow - more than 0.5 sec on my latpop).
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}"

@grtjn
Copy link
Contributor Author

grtjn commented May 28, 2015

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

@grtjn
Copy link
Contributor Author

grtjn commented Jun 1, 2017

Somewhere in the past year a version command was added. It requires string parsing to get out unfortunately, but should be doable..

@grtjn
Copy link
Contributor Author

grtjn commented Jun 8, 2017

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..

@grtjn
Copy link
Contributor Author

grtjn commented Jun 8, 2017

I'd consider closing this, if we can't think of a good use case..

@grtjn
Copy link
Contributor Author

grtjn commented Jun 8, 2017

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..

@grtjn
Copy link
Contributor Author

grtjn commented Jun 14, 2017

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.

@grtjn grtjn closed this as completed Jun 14, 2017
@grtjn grtjn added the wontfix label Jun 14, 2017
@grtjn grtjn self-assigned this Jun 14, 2017
@grtjn grtjn added this to the July 2017 milestone Jun 14, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants