Trying to run a job, but i keep getting this error. I do not know how to resolve it. Is there something im missing? What is wrong here?
This is in my shell
[cloudera#localhost home]$ hadoop jar cloudera/MinMaxCountDriver.jar MinMaxCount /user/cloudera/Comments.xml /user/cloudera/SuperUserXML/
This is the error i am getting
Exception in thread "main" java.lang.ClassNotFoundException: MinMaxCount
....
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:247)
at org.apache.hadoop.util.RunJar.main(RunJar.java:201)
Here is my driver.
public class MinMaxCountDriver {
public static void main(String []args) throws Exception
{
Configuration conf = new Configuration();
String [] otherArgs = new GenericOptionsParser(conf, args).getRemainingArgs();
if(otherArgs.length !=2 )
{
System.err.println("You need 2 Arguement");
System.exit(2);
}
...
FileInputFormat.addInputPath(job, new Path(otherArgs[0]));
FileOutputFormat.setOutputPath(job, new Path(otherArgs[1]));
System.exit(job.waitForCompletion(true)? 0: 1);
}
}
Basic command to run MR jobs is
hadoop jar myjar.jar classname inputfolder outputfolder
For me it works without classname also
myproject
|
|
-----> mypackage
|
|
---->Driver.java
|
|
---->Mapper.java
|
|
---->Reducer.java
If this is the tree I need not want to specify the classname
hadoop jar driver.jar in out
But
myproject
|
|
-----> mypackage
| |
| |
| ---->Driver.java
| |
| |
| ---->Mapper.java
| |
| |
| ---->Reducer.java
|
----> mypackage2
|
|
---->Driver2.java
|
|
---->Mapper2.java
|
|
---->Reducer2.java
For this I need to specify my classname which driver class I am trying to execute.
hadoop jar driver2.jar mypackage2.Driver2 in out
Each class in the .jar has [package MapRedDesign;] at the top.
Based on your comments, make sure you fully qualify your class name with the package, otherwise Java will have no idea where to find it.
hadoop jar cloudera/MinMaxCountDriver.jar MapRedDesign.MinMaxCount /user/cloudera/Comments.xml /user/cloudera/SuperUserXML/
Related
Hello beautiful humans!
I'm working on building a project that uses React Webapp for the frontend, using Prisma to go from javascript to MySql with Aiven to then Twitter API to create auto posts.
GitHub: https://github.com/jennjunod/twitter-tagging
Using this guide from Prisma... Using Miro as a visual representation
Failed to compile.
Error in ./src/reportWebVitals.js
Syntax error: 'import' and 'export' may only appear at the top level (3:0)
1 | const reportWebVitals = onPerfEntry => {
2 | if (onPerfEntry && onPerfEntry instanceof Function) {
> 3 | import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {
| ^
4 | getCLS(onPerfEntry);
5 | getFID(onPerfEntry);
6 | getFCP(onPerfEntry);
# ./src/index.js 19:23-54
I recently dicovered Gatsby and I want to use this template for my own website:
https://github.com/toboko/gatsby-starter-fine
When downloading it, manage to run it http://localhost:8000/ but I get this error which I can escape:
TypeError: strings.slice(...).reduce is not a function
I added my repository here so you can take a look too: https://github.com/melariza/gatsby-starter-fine
Could you take a look and help fix it?
Screenshot of the error:
enter image description here
Here's the error text:
TypeError: strings.slice(...).reduce is not a function
css
/Users/mga/Sites/gatsby-starter-fine/.cache/loading-indicator/style.js:5
2 |
3 | function css(strings, ...keys) {
4 | const lastIndex = strings.length - 1
> 5 | return (
6 | strings.slice(0, lastIndex).reduce((p, s, i) => p + s + keys[i], ``) +
7 | strings[lastIndex]
8 | )
View compiled
Style
/Users/mga/Sites/gatsby-starter-fine/.cache/loading-indicator/style.js:14
11 | const Style = () => (
12 | <style
13 | dangerouslySetInnerHTML={{
> 14 | __html: css`
15 | :host {
16 | --purple-60: #663399;
17 | --gatsby: var(--purple-60);
View compiled
▶ 18 stack frames were collapsed.
(anonymous function)
/Users/mga/Sites/gatsby-starter-fine/.cache/app.js:165
162 | dismissLoadingIndicator()
163 | }
164 |
> 165 | renderer(<Root />, rootElement, () => {
166 | apiRunner(`onInitialClientRender`)
167 |
168 | // Render query on demand overlay
View compiled
I guess the problem is related to Node and its dependencies. The repository is not an official Gatsby starter and the last commit dates from 3 years ago. Gatsby is now on version 4.14 while the starter is on ^2.0.50. Two major versions happened during the last 3 years only in Gatsby so imagine the rest of the dependencies.
The starter doesn't contain a .nvmrc file or engine property in the package.json so the Node version that runs that project is unknown. Be aware that if you clone or fork that project, you will have a lot of deprecated dependencies and you'll have several migrations to do (from v2 to v3 and from v3 to v4).
So my advice is to reject that repository and use one of the officials. If that's not an option, try playing around with the version of Node, starting from 12 onwards, reinstalling the node_modules each time you upgrade or downgrade the version.
I want to extract the pair verb-noun of my text using dependency parsing.
I did this:
document = nlp('appoint department heads or managers and assign or delegate responsibilities to them ')
print ("{:<15} | {:<8} | {:<15} | {:<20}".format('Token','Relation','Head', 'Children'))
print ("-" * 70)
for token in document:
print ("{:<15} | {:<8} | {:<15} | {:<20}"
.format(str(token.text), str(token.dep_), str(token.head.text), str([child for child in token.children])))
from spacy import displacy
displacy.render(document, style = 'dep', jupyter=True )
Can you guys help me do a cleaner one?
This question already has an answer here:
Support passing from Scenario Outline to JSON file
(1 answer)
Closed 2 years ago.
I am struggling with the following test, which is usually pretty easy...
Feature: Testing Env Create Feature
Scenario Outline: Create works as intended
Given url "http://localhost:10000/api/envs"
And request {"name": <Name>,"gcpProjectName": <GcpProjectName>,"url": <Url>}
When method POST
Then status 201
And match response contains {"id": #string, "name": <Name>,"gcpProjectName": <GcpProjectName>,"url": <Url>}
Examples:
| Name | GcpProjectName | Url |
| tests | D-COO-ContinuousCollaboration | https://fake.com |
| approval | Q-COO-ContinuousCollaboration | https://fake.com |
| demo | P-COO-ContinuousCollaboration | https://fake.com |
| prod | P-COO-ContinuousCollaboration | https://fake.com |
I am supposed to get a response summarizing my POST request that I successfully get using curl, Postman or even Swagger, but it does not appear with Karate:
[failed features:
src.test.features.envtest.env-create: [1.1:13] env-create.feature:9 - path: $, actual: '', expected: '{"id":"#string","name":"tests","gcpProjectName":"D-COO-ContinuousCollaboration","url":"https://fake.com"}', reason: not a sub-string
Anyone knows what happens ?
Thanks for your help.
Just add quotes around string substitutions:
And request {"name": "<Name>", "gcpProjectName": "<GcpProjectName>", "url": "<Url>" }
Is there a possibility to get the full path of the currently executing TCL script?
In PHP it would be: __FILE__
Depending on what you mean by "currently executing TCL script", you might actually seek info script, or possibly even info nameofexecutable or something more esoteric.
The correct way to retrieve the name of the file that the current statement resides in, is this (a true equivalent to PHP/C++'s __FILE__):
set thisFile [ dict get [ info frame 0 ] file ]
Psuedocode (how it works):
set thisFile <value> : sets variable thisFile to value
dict get <dict> file : returns the file value from a dict
info frame <#> : returns a dict with information about the frame at the specified stack level (#), and 0 will return the most recent stack frame
NOTICE: See end of post for more information on info frame.
In this case, the file value returned from info frame is already normalized, so file normalize <path> in not needed.
The difference between info script and info frame is mainly for use with Tcl Packages. If info script was used in a Tcl file that was provided durring a package require (require package <name>), then info script would return the path to the currently executing Tcl script and would not provide the actual name of the Tcl file that contained the info script command; However, the info frame example provided here would correctly return the file name of the file that contains the command.
If you want the name of the script currently being evaluated, then:
set sourcedScript [ info script ]
If you want the name of the script (or interpreter) that was initially invoked, then:
set scriptAtInvocation $::argv0
If you want the name of the executable that was initially invoked, then:
set exeAtInvocation [ info nameofexecutable ]
UPDATE - Details about: info frame
Here is what a stacktrace looks like within Tcl. The frame_index is the showing us what info frame $frame_index looks like for values from 0 through [ info frame ].
Calling info frame [ info frame ] is functionally equivalent to info frame 0, but using 0 is of course faster.
There are only actually 1 to [ info frame ] stack frames, and 0 behaves like [ info frame ]. In this example you can see that 0 and 5 (which is [ info frame ]) are the same:
frame_index: 0 | type = source | proc = ::stacktrace | line = 26 | level = 0 | file = /tcltest/stacktrace.tcl | cmd = info frame $frame_counter
frame_index: 1 | type = source | line = 6 | level = 4 | file = /tcltest/main.tcl | cmd = a
frame_index: 2 | type = source | proc = ::a | line = 2 | level = 3 | file = /tcltest/a.tcl | cmd = b
frame_index: 3 | type = source | proc = ::b | line = 2 | level = 2 | file = /tcltest/b.tcl | cmd = c
frame_index: 4 | type = source | proc = ::c | line = 5 | level = 1 | file = /tcltest/c.tcl | cmd = stacktrace
frame_index: 5 | type = source | proc = ::stacktrace | line = 26 | level = 0 | file = /tcltest/stacktrace.tcl | cmd = info frame $frame_counter
See:
https://github.com/Xilinx/XilinxTclStore/blob/master/tclapp/xilinx/profiler/app.tcl#L273
You want $argv0
You can use [file normalize] to get the fully normalized name, too.
file normalize $argv0
file normalize [info nameofexecutable]
seconds after I've posted my question ... lindex $argv 0 is a good starting point ;-)