首页
\
问答
\
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 ...
-
Heroku Python:设置和获取cookie的正确方法是什么?(Heroku Python: What is the proper way to set and get cookies?)[2024-03-26]
您将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 ... -
在CURL中使用cookie jar时如何注入cookie?(How do I inject cookies when using a cookie jar in CURL?)[2022-09-06]
我发现如果你使用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 ... -
在PHP中设置多个Cookie(Setting Multiple Cookies in PHP)[2022-10-08]
使用: '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(Issue setting cookies)[2022-04-04]
确保在输出之前设置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 ...