realm

mac os 部署hadoop之后报 Unable to load realm info from

 ̄綄美尐妖づ 提交于 2019-12-05 07:54:48
hadoop启动日志里异常信息: Unable to load realm info from SCDynamicStore 搜索后发现很早就有人提交给Hadoop了:https://issues.apache.org/jira/browse/HADOOP-7489 ,这个好像解决的方法不是很全面 正确的解决办法是: 指定jdk版本(jdk6) 修改JVM的参数配置 以2.2.0的版本为例: 1、在<HADOOP_HOME>/etc/hadoop/hadoop-env.sh 中找到 “export HADOOP_OPTS” ,再增加一行配置: export HADOOP_OPTS=”$HADOOP_OPTS -Djava.security.krb5.realm=OX.AC.UK -Djava.security.krb5.kdc=kdc0.ox.ac.uk:kdc1.ox.ac.uk" 1 export HADOOP_OPTS=”$HADOOP_OPTS -Djava.security.krb5.realm=OX.AC.UK -Djava.security.krb5.kdc=kdc0.ox.ac.uk:kdc1.ox.ac.uk" 2、如果是jdk7,即使修改参数后依旧还是有这个错误提示(可能是jdk7的bug),需要指定jdk6运行,至于jdk8 没有测试过。 补充于2014-01

How do i prevent duplicates in RealmSwift List?

半城伤御伤魂 提交于 2019-12-05 07:47:42
How do I prevent adding duplicates to a list in RealmSwift ? I have my User as a realm object, but the real data source is a server (simply caching the user locally with Realm). When I get the current user data from my server, i want to make sure that my user stored in realm has all the playlists coming from the server (and that their in sync wrt list of tracks and etc.). I'm worried that if i loop over those lists from the server, appending to myUser.playlists , that I may end up adding the same playlist to the user's list of playlists multiple times. class User: Object { dynamic var name = "

“kotlin-noarg” plugin don't work in Realm

旧城冷巷雨未停 提交于 2019-12-05 07:13:43
问题 "kotlin-allopen" plugin work but "kotlin-noarg" plugin don't work. How can I do? Below is the code. build.gradle buildscript { ext.kotlin_version = '1.1.3-2' repositories { google() jcenter() } dependencies { classpath 'com.android.tools.build:gradle:3.0.0-beta2' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-allopen:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-noarg:$kotlin_version" classpath "io.realm:realm-gradle

Replace Realm file while app is running

不羁岁月 提交于 2019-12-05 06:37:51
To implement the backup / restore feature, I am deleting the existing Realm database file and replacing it with the new database file with the same name. However, with the app still running it does not see the contents of the new database file. If I quit and relaunch the app, it does see the contents of the new database file. Is there any way to make the app see the new contents without having to relaunch it? Much like deleting a Realm file from disk, it's only safe to replace a Realm file on disk if your application does not currently have the Realm file open. From Realm's documentation on

How can I convert a Realm object to JSON in Swift?

↘锁芯ラ 提交于 2019-12-05 05:29:55
问题 I have two Realm tables declared: class Task: Object { dynamic var taskID: String = "" let taskAssignedTo = List<Contacts>() } class Contacts: Object { dynamic var contactEmail: String = "" dynamic var contactName: String = "" } Final goal is to convert the Task Realm object into JSON. The method I'm thinking of is: Convert the object to a dictionary using a method within the class func taskToDictionary() -> [String: AnyObject] { return [ "taskID" : self.taskID, "taskAssignedTo" : self

Realm access from incorrect thread Android

浪尽此生 提交于 2019-12-05 05:12:28
I am dealing with this issue on Android : Realm access from incorrect thread. Realm objects can only be accessed on the thread they where created. I want to use Realm in my RemoteViewsFactory with public class RemoteViewsX implements RemoteViewsFactory { public RemoteViews getViewAt(int paramInt) { if (this.results != null && this.results.size() != 0 && this.results.get(paramInt) != null) { //FAILED HERE } } ... This call failed! Why ? I fetch my data like this in my class: public void onDataSetChanged() { Realm realm = Realm.getInstance(RemoteViewsX.this.ctx); this.results = realm.where(Model

Tomcat认证授权与简单的SSO

て烟熏妆下的殇ゞ 提交于 2019-12-05 04:36:56
回顾 在前几天,我使用apache+tomcat搭建了一个集群,有一个简单的网站应用。 Apache httpd与tomcat集群 。 今天在此基础上,我要为其开发一个登录页面,并开启网站的认证和授权。 基本概念 在动手之前,我需要先了解网站认证和授权的几个基本组成部分的概念。是什么构成了网站应用的认证和授权? Realm - 翻译过来叫做“域”。Realm是web容器所持有的用户集合。无论tomcat, glassfish,jboss还是websphere,均是符合j2ee规范或最佳实现。Realm是需要网站系统管理员进行配置的。常见的Realm有三种:数据库,LDAP和文件系统。数据库realm是指用户信息都存在数据库中,Ldap则存放在ldap中,文件系统的realm则是用户信息按照一定的格式,存放于文件中。Realm是认证的关键,web容器会将用户输入的用户名和密码跟realm中的用户信息进行比对。当比对成功的时候,认证也就成功了。 Role - 角色。 这是授权的部分。当Realm被配好以后,系统管理员可以为realm中的用户分配角色。建立用户role-mapping. 每次用户通过web容器的认证以后,web容器会将其role信息也查询出来,放入用户信息中。 security-constraint。 这是web应用web.xml中的配置。 一个web应用将在web

Can I use RestKit and Realm.io?

我怕爱的太早我们不能终老 提交于 2019-12-05 03:44:44
I want to use RestKit , but I already use Realm.io instead of CoreData. Is it possible to use RestKit on top of Realm.io? yoshyosh Sure you can. Once you get the object back from RestKit: // GET a single Article from /articles/1234.json and map it into an object // JSON looks like {"article": {"title": "My Article", "author": "Blake", "body": "Very cool!!"}} RKObjectMapping *mapping = [RKObjectMapping mappingForClass:[Article class]]; [mapping addAttributeMappingsFromArray:@[@"title", @"author", @"body"]]; NSIndexSet *statusCodes = RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful); //

How to perform Realm count query

旧街凉风 提交于 2019-12-05 03:29:59
How can I do a count query on Realm? for example this is my model class Dog: Object { dynamic var name = "" } class Person: Object { dynamic var name = "" let dogs = List<Dog>() } I want to fetch all persons with at least one dog something like Realm().objects(Person).filter("dogs.@count > 0") but @count isn't supported as i understand Yes, Realm still does not support .@count query. You can work around that you modify the Person model to have a count property. Then you update the count property when you append a dog object to the dogs array. This feature request is tracked by Issue #1166

Return unique/distinct values with Realm query

时光总嘲笑我的痴心妄想 提交于 2019-12-05 03:27:51
I have a Message/RLMObject model that has a NSString *jabberID property/row and I want to retrieve every unique value inside that row. In other word, I want to retrieve non-repeated jabberID values from my Message model. Can anyone help out figuring this? The way I use to do with coredata was using returnsDistinctResults setting on the NSFetchRequest . Functional programming approach since Swift has it, and Realm lazy loads; Not as easy/available a solution in Objective-C but for Swift at least: Swift let distinctTypes = reduce(Realm().objects(User), []) { $0 + (!contains($0, $1.type) ? [$1