首页 \ 问答 \ hadoop mongodb连接器 - 输出数据不是mongodb而是hdfs(hadoop mongodb connector - output data not as mongodb but hdfs)

hadoop mongodb连接器 - 输出数据不是mongodb而是hdfs(hadoop mongodb connector - output data not as mongodb but hdfs)

是否有可能从hadoop mongodb插件连接器中读取mongodb数据,使用mapreduce hadoop处理数据,并且当输出结果不使用hadoop mongodb插件连接器但是在hdfs中保留mapreduce hadoop的结果?


is it possible read mongodb data from hadoop mongodb plugin connector, processing data with mapreduce hadoop, and when output results not using hadoop mongodb plugin connector but leave result of mapreduce hadoop as is, in hdfs?


原文:https://stackoverflow.com/questions/9965767
更新时间:2022-12-28 17:12

最满意答案

使用两个SimpleCookie对象解决它:

C1 = Cookie.SimpleCookie()
C1["emailAddress"] = self.request.get('emailAddress')
C2 = Cookie.SimpleCookie()
C2["secretCode"] = self.request.get('secretCode')
C2["secretCode"]["path"] = "/"
self.response.headers.add_header("Set-Cookie", C1.output(header=''))
self.response.headers.add_header("Set-Cookie", C2.output(header=''))

Using two SimpleCookie objects solves it:

C1 = Cookie.SimpleCookie()
C1["emailAddress"] = self.request.get('emailAddress')
C2 = Cookie.SimpleCookie()
C2["secretCode"] = self.request.get('secretCode')
C2["secretCode"]["path"] = "/"
self.response.headers.add_header("Set-Cookie", C1.output(header=''))
self.response.headers.add_header("Set-Cookie", C2.output(header=''))

相关问答

更多
  • 您需要从赋值运算符( = )更改为连接和赋值复合运算符( += )。 如果cookie密钥存在,覆盖它也是一个好主意。 因此,我建议将cookie值转换为对象,修改它们,然后序列化为cookie字符串。 You need to change from assignment operator (=) to concatenation and assignment compound operator (+=). It would also be a good idea to overwrite the cook ...
  • .NET的多值cookie与你在django中使用分隔符所做的完全相同。 他们已经为你抽象了。 你在做的事情很好,我认为Django没有什么具体的“解决”这个问题。 我会说你在做正确的事情,不使用多个cookies。 通过做你正在做的事情来保持电线上的开销。 .NETs multi-value cookies work exactly the same way as what you're doing in django using a separator. They've just abstracted ...
  • 我设法解决了这两个问题。 问题#1:上面显示的三个c值中只有两个存储为cookie。 解决方案:我设置了我的cookie,以便在一个cookie中传递三个值。 例如: import Cookie c = Cookie.SimpleCookie() c['id'] = '12345|score=8.76|page=3' # Output the HTTP message containing the cookie BEFORE Content-type text/html! print c print "C ...
  • 您将需要header vmod: https://github.com/varnish/libvmod-header/ 例: header.append(beresp.http.Set-Cookie,"stayAtLocale=1"); 您还可以使用std vmod将所有标题“压缩”为一个: https://www.varnish-cache.org/docs/4.0/reference/vmod_std.generated.html#func-collect You will need the head ...
  • 您将os.environ与当前请求的环境混淆。 它们是完全不同的东西。 os environ是您的计算机的本地,它与Web服务器无关。 对于您正在寻找的环境,您需要在处理请求时进入Web服务器。 也许这会有所帮助: http : //en.wikipedia.org/wiki/Http_request#Technical_overview Figured it out with a url redirect: from flask import make_response, redirect, url_fo ...
  • 我发现如果你使用cookie jar, curl_setopt与CURLOPT_COOKIE它不会覆盖从文件加载的cookie,它只是附加它们。 所以答案是使用CURLOPT_COOKIE 。 谢谢拜伦! I found if you use the cookie jar, and curl_setopt wit CURLOPT_COOKIE it doesn't overwrite the cookies it loaded from the file, it just appends them. So ...
  • 使用: '1', 'UserName' => '1', 'Access_Level' => '1', 'Db_Con' => '1' ); setcookie('user_id', $row['User_ID'], time()+ (60*15),"/"); setcookie('user_name', $row['UserName'], time()+ (60*15),"/"); setcookie(' ...
  • 是的,您应该从请求中获取cookie并将其设置为响应。 HttpResponse中有魔法代码可以克隆要求的新cookie(在您的情况下可能会以某种方式进行预期),因此开发人员可以随机选择从服务器上读取cookie的位置。 在请求生命周期的早期(在响应中设置任何cookie之前)读取cookie可能更清晰,并且在响应时间设置cookie(但不能太迟,因为它必须在响应主体的第一部分刷新到客户端之前发生)。 Yes, you should get cookies from request and set them ...
  • 确保在输出之前设置cookie。 你在哪里叫你的功能? 作为替代方案,您可以使用JS在客户端设置cookie。 Make sure you are setting your cookies before output. Where are you calling your function? As an alternative, you could use JS to set a cookie on client side.
  • 使用两个SimpleCookie对象解决它: C1 = Cookie.SimpleCookie() C1["emailAddress"] = self.request.get('emailAddress') C2 = Cookie.SimpleCookie() C2["secretCode"] = self.request.get('secretCode') C2["secretCode"]["path"] = "/" self.response.headers.add_header("Set-Cookie ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)