@Override public Boolean load(String key) throws Exception { return configManager.getConfig(key, InternalConfig.USER_TYPE.name(), FieldType.class) == FieldType.STRING; } });
@Override public FieldType load(String key) throws Exception { return configManager.setConfigOnce(key, InternalConfig.USER_TYPE.name(), STRING); } });
@Override public Optional<FieldType> load(String key) throws Exception { return Optional.ofNullable(configManager.getConfig(key, USER_TYPE.name(), FieldType.class)); } });
@Subscribe public void onCreateProject(SystemEvents.ProjectCreatedEvent event) { FieldType type = configManager.getConfig(event.project, USER_TYPE.name(), FieldType.class); if (type != null) { if (storage.isPresent()) { storage.get().createProjectIfNotExists(event.project, type.isNumeric()); } } } }
FieldType type = STRING; if (name.equals(projectConfig)) { type = configManager.setConfigOnce(project, USER_TYPE.name(), STRING);
FieldType other = (id instanceof Long ? FieldType.LONG : (id instanceof Integer ? FieldType.INTEGER : FieldType.STRING)); FieldType fieldType = configManager.setConfigOnce(project, USER_TYPE.name(), other); createProjectIfNotExists(project, fieldType.isNumeric()); columns = loadColumns(project);
public void mergeInternal(String project, Object user, Object anonymousId, Instant createdAt, Instant mergedAt) { FieldType config = configManager.getConfig(project, USER_TYPE.name(), FieldType.class); GenericData.Record properties = new GenericData.Record(ANONYMOUS_USER_MAPPING_SCHEMA.get(config)); properties.put(0, anonymousId.toString()); try { if (config == FieldType.STRING) { properties.put(1, user.toString()); } else if (config == FieldType.LONG) { properties.put(1, Long.parseLong(user.toString())); } else if (config == FieldType.INTEGER) { properties.put(1, Integer.parseInt(user.toString())); } else { throw new IllegalStateException(); } } catch (NumberFormatException e) { throw new RakamException("User type doesn't match", HttpResponseStatus.BAD_REQUEST); } properties.put(2, createdAt.toEpochMilli()); properties.put(3, mergedAt.toEpochMilli()); eventStore.store(new Event(project, ANONYMOUS_ID_MAPPING, null, ANONYMOUS_USER_MAPPING.get(config), properties)); }
FieldType type; if (e.getName().equals("_user")) { type = configManager.setConfigOnce(project, USER_TYPE.name(), STRING); } else { type = e.getType();
type = configManager.setConfigOnce(project, USER_TYPE.name(), eventUserType); if (!masterKey && TRUE.equals(configManager.getConfig(project, FIXED_SCHEMA.name(), Boolean.class))) { throw new RakamException("Schema is invalid", BAD_REQUEST); newFields.add(new SchemaField("_user", configManager.setConfigOnce(project, USER_TYPE.name(), STRING)));
FieldType other = (id instanceof Long ? FieldType.LONG : (id instanceof Integer ? FieldType.INTEGER : FieldType.STRING)); FieldType fieldType = configManager.setConfigOnce(project, USER_TYPE.name(), other);
@Override public FieldType load(String key) throws Exception { return configManager.setConfigOnce(key, InternalConfig.USER_TYPE.name(), STRING); } });